@discomedia/utils 1.0.33 → 1.0.34
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/index-frontend.cjs +27 -3
- package/dist/index-frontend.cjs.map +1 -1
- package/dist/index-frontend.mjs +27 -3
- package/dist/index-frontend.mjs.map +1 -1
- package/dist/index.cjs +12 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +12 -3
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/dist/test.js +5527 -760
- package/dist/test.js.map +1 -1
- package/dist/types/alpaca-trading-api.d.ts.map +1 -1
- package/dist/types/types/alpaca-types.d.ts +10 -1
- package/dist/types/types/alpaca-types.d.ts.map +1 -1
- package/dist/types-frontend/alpaca-trading-api.d.ts.map +1 -1
- package/dist/types-frontend/types/alpaca-types.d.ts +10 -1
- package/dist/types-frontend/types/alpaca-types.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/alpaca-crypto-pairs-DMOvRyzw.js +0 -571
- package/dist/alpaca-crypto-pairs-DMOvRyzw.js.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -18211,9 +18211,18 @@ class AlpacaTradingAPI {
|
|
|
18211
18211
|
// Get the most recent hourly data point
|
|
18212
18212
|
const mostRecentHourly = recentHourlyData[recentHourlyData.length - 1];
|
|
18213
18213
|
const mostRecentIndex = mostRecentHourly.index;
|
|
18214
|
-
// Calculate the timestamp for the new daily entry
|
|
18215
|
-
|
|
18216
|
-
|
|
18214
|
+
// Calculate the timestamp for the new daily entry.
|
|
18215
|
+
// Alpaca's daily history timestamps are at 00:00:00Z for the calendar day
|
|
18216
|
+
// following the NY trading date. Derive the trading date in NY time from the
|
|
18217
|
+
// most recent intraday timestamp, then set the new daily timestamp to
|
|
18218
|
+
// midnight UTC of the next calendar day.
|
|
18219
|
+
const mostRecentMs = mostRecentHourly.timestamp * 1000; // hourly timestamps are seconds
|
|
18220
|
+
const tradingDateStr = getTradingDate(new Date(mostRecentMs)); // e.g., '2025-09-05' (NY trading date)
|
|
18221
|
+
const [yearStr, monthStr, dayStr] = tradingDateStr.split('-');
|
|
18222
|
+
const year = Number(yearStr);
|
|
18223
|
+
const month = Number(monthStr); // 1-based
|
|
18224
|
+
const day = Number(dayStr);
|
|
18225
|
+
const newDailyTimestamp = Math.floor(Date.UTC(year, month - 1, day + 1, 0, 0, 0, 0) / 1000);
|
|
18217
18226
|
// Create a new daily history entry with the most recent hourly values
|
|
18218
18227
|
const updatedDailyHistory = {
|
|
18219
18228
|
...dailyHistory,
|