backtest-kit 3.0.9 → 3.0.10
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/build/index.cjs +8 -4
- package/build/index.mjs +8 -4
- package/package.json +1 -1
package/build/index.cjs
CHANGED
|
@@ -2602,8 +2602,10 @@ class ClientExchange {
|
|
|
2602
2602
|
symbol,
|
|
2603
2603
|
depth,
|
|
2604
2604
|
});
|
|
2605
|
-
const
|
|
2606
|
-
const
|
|
2605
|
+
const whenTimestamp = this.params.execution.context.when.getTime();
|
|
2606
|
+
const alignedTo = ALIGN_TO_INTERVAL_FN$1(whenTimestamp, GLOBAL_CONFIG.CC_ORDER_BOOK_TIME_OFFSET_MINUTES);
|
|
2607
|
+
const to = new Date(alignedTo);
|
|
2608
|
+
const from = new Date(alignedTo -
|
|
2607
2609
|
GLOBAL_CONFIG.CC_ORDER_BOOK_TIME_OFFSET_MINUTES * MS_PER_MINUTE$2);
|
|
2608
2610
|
return await this.params.getOrderBook(symbol, depth, from, to, this.params.execution.context.backtest);
|
|
2609
2611
|
}
|
|
@@ -35930,8 +35932,10 @@ class ExchangeInstance {
|
|
|
35930
35932
|
symbol,
|
|
35931
35933
|
depth,
|
|
35932
35934
|
});
|
|
35933
|
-
const
|
|
35934
|
-
const
|
|
35935
|
+
const when = await GET_TIMESTAMP_FN();
|
|
35936
|
+
const alignedTo = ALIGN_TO_INTERVAL_FN(when.getTime(), GLOBAL_CONFIG.CC_ORDER_BOOK_TIME_OFFSET_MINUTES);
|
|
35937
|
+
const to = new Date(alignedTo);
|
|
35938
|
+
const from = new Date(alignedTo - GLOBAL_CONFIG.CC_ORDER_BOOK_TIME_OFFSET_MINUTES * MS_PER_MINUTE$1);
|
|
35935
35939
|
const isBacktest = await GET_BACKTEST_FN();
|
|
35936
35940
|
return await this._methods.getOrderBook(symbol, depth, from, to, isBacktest);
|
|
35937
35941
|
};
|
package/build/index.mjs
CHANGED
|
@@ -2582,8 +2582,10 @@ class ClientExchange {
|
|
|
2582
2582
|
symbol,
|
|
2583
2583
|
depth,
|
|
2584
2584
|
});
|
|
2585
|
-
const
|
|
2586
|
-
const
|
|
2585
|
+
const whenTimestamp = this.params.execution.context.when.getTime();
|
|
2586
|
+
const alignedTo = ALIGN_TO_INTERVAL_FN$1(whenTimestamp, GLOBAL_CONFIG.CC_ORDER_BOOK_TIME_OFFSET_MINUTES);
|
|
2587
|
+
const to = new Date(alignedTo);
|
|
2588
|
+
const from = new Date(alignedTo -
|
|
2587
2589
|
GLOBAL_CONFIG.CC_ORDER_BOOK_TIME_OFFSET_MINUTES * MS_PER_MINUTE$2);
|
|
2588
2590
|
return await this.params.getOrderBook(symbol, depth, from, to, this.params.execution.context.backtest);
|
|
2589
2591
|
}
|
|
@@ -35910,8 +35912,10 @@ class ExchangeInstance {
|
|
|
35910
35912
|
symbol,
|
|
35911
35913
|
depth,
|
|
35912
35914
|
});
|
|
35913
|
-
const
|
|
35914
|
-
const
|
|
35915
|
+
const when = await GET_TIMESTAMP_FN();
|
|
35916
|
+
const alignedTo = ALIGN_TO_INTERVAL_FN(when.getTime(), GLOBAL_CONFIG.CC_ORDER_BOOK_TIME_OFFSET_MINUTES);
|
|
35917
|
+
const to = new Date(alignedTo);
|
|
35918
|
+
const from = new Date(alignedTo - GLOBAL_CONFIG.CC_ORDER_BOOK_TIME_OFFSET_MINUTES * MS_PER_MINUTE$1);
|
|
35915
35919
|
const isBacktest = await GET_BACKTEST_FN();
|
|
35916
35920
|
return await this._methods.getOrderBook(symbol, depth, from, to, isBacktest);
|
|
35917
35921
|
};
|