@discomedia/utils 1.0.27 → 1.0.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15405,12 +15405,13 @@ class AlpacaTradingAPI {
15405
15405
  * @returns Portfolio history data with daily timeframe, including the most recent day if available from hourly data
15406
15406
  */
15407
15407
  async getPortfolioDailyHistory(params) {
15408
- // Get daily history
15408
+ // Get daily and hourly history in parallel
15409
15409
  const dailyParams = { ...params, timeframe: '1D' };
15410
- const dailyHistory = await this.getPortfolioHistory(dailyParams);
15411
- // Get hourly history for the last day to check for more recent data
15412
15410
  const hourlyParams = { timeframe: '1H', period: '1D' };
15413
- const hourlyHistory = await this.getPortfolioHistory(hourlyParams);
15411
+ const [dailyHistory, hourlyHistory] = await Promise.all([
15412
+ this.getPortfolioHistory(dailyParams),
15413
+ this.getPortfolioHistory(hourlyParams)
15414
+ ]);
15414
15415
  // If no hourly history, return daily as-is
15415
15416
  if (!hourlyHistory.timestamp || hourlyHistory.timestamp.length === 0) {
15416
15417
  return dailyHistory;