backtest-kit 1.5.5 → 1.5.6

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 CHANGED
@@ -3179,17 +3179,15 @@ class ClientStrategy {
3179
3179
  backtest,
3180
3180
  });
3181
3181
  this._isStopped = true;
3182
- if (!this._pendingSignal) {
3182
+ // Clear scheduled signal if exists
3183
+ if (!this._scheduledSignal) {
3183
3184
  return;
3184
3185
  }
3185
- this._pendingSignal = null;
3186
- if (this.params.callbacks?.onWrite) {
3187
- this.params.callbacks.onWrite(symbol, this._pendingSignal, backtest);
3188
- }
3186
+ this._scheduledSignal = null;
3189
3187
  if (backtest) {
3190
3188
  return;
3191
3189
  }
3192
- await PersistScheduleAdapter.writeScheduleData(this._pendingSignal, symbol, strategyName);
3190
+ await PersistScheduleAdapter.writeScheduleData(this._scheduledSignal, symbol, strategyName);
3193
3191
  }
3194
3192
  }
3195
3193
 
package/build/index.mjs CHANGED
@@ -3177,17 +3177,15 @@ class ClientStrategy {
3177
3177
  backtest,
3178
3178
  });
3179
3179
  this._isStopped = true;
3180
- if (!this._pendingSignal) {
3180
+ // Clear scheduled signal if exists
3181
+ if (!this._scheduledSignal) {
3181
3182
  return;
3182
3183
  }
3183
- this._pendingSignal = null;
3184
- if (this.params.callbacks?.onWrite) {
3185
- this.params.callbacks.onWrite(symbol, this._pendingSignal, backtest);
3186
- }
3184
+ this._scheduledSignal = null;
3187
3185
  if (backtest) {
3188
3186
  return;
3189
3187
  }
3190
- await PersistScheduleAdapter.writeScheduleData(this._pendingSignal, symbol, strategyName);
3188
+ await PersistScheduleAdapter.writeScheduleData(this._scheduledSignal, symbol, strategyName);
3191
3189
  }
3192
3190
  }
3193
3191
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "1.5.5",
3
+ "version": "1.5.6",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",