@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.
- package/dist/{alpaca-trading-api-6NxNgQBn.js → alpaca-trading-api-BMvFXbgI.js} +6 -5
- package/dist/{alpaca-trading-api-6NxNgQBn.js.map → alpaca-trading-api-BMvFXbgI.js.map} +1 -1
- package/dist/index-frontend.cjs +5 -4
- package/dist/index-frontend.cjs.map +1 -1
- package/dist/index-frontend.mjs +5 -4
- package/dist/index-frontend.mjs.map +1 -1
- package/dist/index.cjs +5 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +5 -4
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/dist/test.js +1 -1
- package/dist/types/alpaca-trading-api.d.ts.map +1 -1
- package/dist/types-frontend/alpaca-trading-api.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -17839,12 +17839,13 @@ class AlpacaTradingAPI {
|
|
|
17839
17839
|
* @returns Portfolio history data with daily timeframe, including the most recent day if available from hourly data
|
|
17840
17840
|
*/
|
|
17841
17841
|
async getPortfolioDailyHistory(params) {
|
|
17842
|
-
// Get daily history
|
|
17842
|
+
// Get daily and hourly history in parallel
|
|
17843
17843
|
const dailyParams = { ...params, timeframe: '1D' };
|
|
17844
|
-
const dailyHistory = await this.getPortfolioHistory(dailyParams);
|
|
17845
|
-
// Get hourly history for the last day to check for more recent data
|
|
17846
17844
|
const hourlyParams = { timeframe: '1H', period: '1D' };
|
|
17847
|
-
const hourlyHistory = await
|
|
17845
|
+
const [dailyHistory, hourlyHistory] = await Promise.all([
|
|
17846
|
+
this.getPortfolioHistory(dailyParams),
|
|
17847
|
+
this.getPortfolioHistory(hourlyParams)
|
|
17848
|
+
]);
|
|
17848
17849
|
// If no hourly history, return daily as-is
|
|
17849
17850
|
if (!hourlyHistory.timestamp || hourlyHistory.timestamp.length === 0) {
|
|
17850
17851
|
return dailyHistory;
|