backtest-kit 2.2.13 → 2.2.14

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
@@ -31625,6 +31625,7 @@ class StorageBacktestUtils {
31625
31625
  ...tick.signal,
31626
31626
  status: "opened",
31627
31627
  priority: Date.now(),
31628
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31628
31629
  updatedAt: tick.createdAt,
31629
31630
  });
31630
31631
  await this._updateStorage();
@@ -31648,6 +31649,7 @@ class StorageBacktestUtils {
31648
31649
  ...tick.signal,
31649
31650
  status: "closed",
31650
31651
  priority: Date.now(),
31652
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31651
31653
  updatedAt: tick.createdAt,
31652
31654
  });
31653
31655
  await this._updateStorage();
@@ -31671,6 +31673,7 @@ class StorageBacktestUtils {
31671
31673
  ...tick.signal,
31672
31674
  status: "scheduled",
31673
31675
  priority: Date.now(),
31676
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31674
31677
  updatedAt: tick.createdAt,
31675
31678
  });
31676
31679
  await this._updateStorage();
@@ -31694,6 +31697,7 @@ class StorageBacktestUtils {
31694
31697
  ...tick.signal,
31695
31698
  status: "cancelled",
31696
31699
  priority: Date.now(),
31700
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31697
31701
  updatedAt: tick.createdAt,
31698
31702
  });
31699
31703
  await this._updateStorage();
@@ -31790,6 +31794,7 @@ class StorageLiveUtils {
31790
31794
  ...tick.signal,
31791
31795
  status: "opened",
31792
31796
  priority: Date.now(),
31797
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31793
31798
  updatedAt: tick.createdAt,
31794
31799
  });
31795
31800
  await this._updateStorage();
@@ -31813,6 +31818,7 @@ class StorageLiveUtils {
31813
31818
  ...tick.signal,
31814
31819
  status: "closed",
31815
31820
  priority: Date.now(),
31821
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31816
31822
  updatedAt: tick.createdAt,
31817
31823
  });
31818
31824
  await this._updateStorage();
@@ -31836,6 +31842,7 @@ class StorageLiveUtils {
31836
31842
  ...tick.signal,
31837
31843
  status: "scheduled",
31838
31844
  priority: Date.now(),
31845
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31839
31846
  updatedAt: tick.createdAt,
31840
31847
  });
31841
31848
  await this._updateStorage();
@@ -31859,6 +31866,7 @@ class StorageLiveUtils {
31859
31866
  ...tick.signal,
31860
31867
  status: "cancelled",
31861
31868
  priority: Date.now(),
31869
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31862
31870
  updatedAt: tick.createdAt,
31863
31871
  });
31864
31872
  await this._updateStorage();
package/build/index.mjs CHANGED
@@ -31605,6 +31605,7 @@ class StorageBacktestUtils {
31605
31605
  ...tick.signal,
31606
31606
  status: "opened",
31607
31607
  priority: Date.now(),
31608
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31608
31609
  updatedAt: tick.createdAt,
31609
31610
  });
31610
31611
  await this._updateStorage();
@@ -31628,6 +31629,7 @@ class StorageBacktestUtils {
31628
31629
  ...tick.signal,
31629
31630
  status: "closed",
31630
31631
  priority: Date.now(),
31632
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31631
31633
  updatedAt: tick.createdAt,
31632
31634
  });
31633
31635
  await this._updateStorage();
@@ -31651,6 +31653,7 @@ class StorageBacktestUtils {
31651
31653
  ...tick.signal,
31652
31654
  status: "scheduled",
31653
31655
  priority: Date.now(),
31656
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31654
31657
  updatedAt: tick.createdAt,
31655
31658
  });
31656
31659
  await this._updateStorage();
@@ -31674,6 +31677,7 @@ class StorageBacktestUtils {
31674
31677
  ...tick.signal,
31675
31678
  status: "cancelled",
31676
31679
  priority: Date.now(),
31680
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31677
31681
  updatedAt: tick.createdAt,
31678
31682
  });
31679
31683
  await this._updateStorage();
@@ -31770,6 +31774,7 @@ class StorageLiveUtils {
31770
31774
  ...tick.signal,
31771
31775
  status: "opened",
31772
31776
  priority: Date.now(),
31777
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31773
31778
  updatedAt: tick.createdAt,
31774
31779
  });
31775
31780
  await this._updateStorage();
@@ -31793,6 +31798,7 @@ class StorageLiveUtils {
31793
31798
  ...tick.signal,
31794
31799
  status: "closed",
31795
31800
  priority: Date.now(),
31801
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31796
31802
  updatedAt: tick.createdAt,
31797
31803
  });
31798
31804
  await this._updateStorage();
@@ -31816,6 +31822,7 @@ class StorageLiveUtils {
31816
31822
  ...tick.signal,
31817
31823
  status: "scheduled",
31818
31824
  priority: Date.now(),
31825
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31819
31826
  updatedAt: tick.createdAt,
31820
31827
  });
31821
31828
  await this._updateStorage();
@@ -31839,6 +31846,7 @@ class StorageLiveUtils {
31839
31846
  ...tick.signal,
31840
31847
  status: "cancelled",
31841
31848
  priority: Date.now(),
31849
+ createdAt: lastStorage ? lastStorage.createdAt : tick.createdAt,
31842
31850
  updatedAt: tick.createdAt,
31843
31851
  });
31844
31852
  await this._updateStorage();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "2.2.13",
3
+ "version": "2.2.14",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -1135,6 +1135,8 @@ interface IPublicSignalRow extends ISignalRow {
1135
1135
  * Used for persisting signals with accurate creation time.
1136
1136
  */
1137
1137
  interface IStorageSignalRow extends IPublicSignalRow {
1138
+ /** Creation timestamp taken from IStrategyTickResult */
1139
+ createdAt: number;
1138
1140
  /** Creation timestamp taken from IStrategyTickResult */
1139
1141
  updatedAt: number;
1140
1142
  /** Storage adapter rewrite priority. Equal to Date.now for live and backtest both */