backtest-kit 2.2.18 → 2.2.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "backtest-kit",
3
- "version": "2.2.18",
3
+ "version": "2.2.19",
4
4
  "description": "A TypeScript library for trading system backtest",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -1036,6 +1036,14 @@ interface PartialProfitCommit extends SignalCommitBase {
1036
1036
  action: "partial-profit";
1037
1037
  percentToClose: number;
1038
1038
  currentPrice: number;
1039
+ position: "long" | "short";
1040
+ priceOpen: number;
1041
+ priceTakeProfit: number;
1042
+ priceStopLoss: number;
1043
+ originalPriceTakeProfit: number;
1044
+ originalPriceStopLoss: number;
1045
+ scheduledAt: number;
1046
+ pendingAt: number;
1039
1047
  }
1040
1048
  /**
1041
1049
  * Partial loss event.
@@ -1044,6 +1052,14 @@ interface PartialLossCommit extends SignalCommitBase {
1044
1052
  action: "partial-loss";
1045
1053
  percentToClose: number;
1046
1054
  currentPrice: number;
1055
+ position: "long" | "short";
1056
+ priceOpen: number;
1057
+ priceTakeProfit: number;
1058
+ priceStopLoss: number;
1059
+ originalPriceTakeProfit: number;
1060
+ originalPriceStopLoss: number;
1061
+ scheduledAt: number;
1062
+ pendingAt: number;
1047
1063
  }
1048
1064
  /**
1049
1065
  * Trailing stop event.
@@ -1052,6 +1068,14 @@ interface TrailingStopCommit extends SignalCommitBase {
1052
1068
  action: "trailing-stop";
1053
1069
  percentShift: number;
1054
1070
  currentPrice: number;
1071
+ position: "long" | "short";
1072
+ priceOpen: number;
1073
+ priceTakeProfit: number;
1074
+ priceStopLoss: number;
1075
+ originalPriceTakeProfit: number;
1076
+ originalPriceStopLoss: number;
1077
+ scheduledAt: number;
1078
+ pendingAt: number;
1055
1079
  }
1056
1080
  /**
1057
1081
  * Trailing take event.
@@ -1060,6 +1084,14 @@ interface TrailingTakeCommit extends SignalCommitBase {
1060
1084
  action: "trailing-take";
1061
1085
  percentShift: number;
1062
1086
  currentPrice: number;
1087
+ position: "long" | "short";
1088
+ priceOpen: number;
1089
+ priceTakeProfit: number;
1090
+ priceStopLoss: number;
1091
+ originalPriceTakeProfit: number;
1092
+ originalPriceStopLoss: number;
1093
+ scheduledAt: number;
1094
+ pendingAt: number;
1063
1095
  }
1064
1096
  /**
1065
1097
  * Breakeven event.
@@ -1067,6 +1099,14 @@ interface TrailingTakeCommit extends SignalCommitBase {
1067
1099
  interface BreakevenCommit extends SignalCommitBase {
1068
1100
  action: "breakeven";
1069
1101
  currentPrice: number;
1102
+ position: "long" | "short";
1103
+ priceOpen: number;
1104
+ priceTakeProfit: number;
1105
+ priceStopLoss: number;
1106
+ originalPriceTakeProfit: number;
1107
+ originalPriceStopLoss: number;
1108
+ scheduledAt: number;
1109
+ pendingAt: number;
1070
1110
  }
1071
1111
  /**
1072
1112
  * Discriminated union for strategy management signal events.
@@ -6664,6 +6704,18 @@ interface PartialProfitAvailableNotification {
6664
6704
  priceOpen: number;
6665
6705
  /** Trade direction: "long" (buy) or "short" (sell) */
6666
6706
  position: "long" | "short";
6707
+ /** Effective take profit price (with trailing if set) */
6708
+ priceTakeProfit: number;
6709
+ /** Effective stop loss price (with trailing if set) */
6710
+ priceStopLoss: number;
6711
+ /** Original take profit price before any trailing adjustments */
6712
+ originalPriceTakeProfit: number;
6713
+ /** Original stop loss price before any trailing adjustments */
6714
+ originalPriceStopLoss: number;
6715
+ /** Signal creation timestamp in milliseconds (when signal was first created/scheduled) */
6716
+ scheduledAt: number;
6717
+ /** Pending timestamp in milliseconds (when position became pending/active at priceOpen) */
6718
+ pendingAt: number;
6667
6719
  /** Unix timestamp in milliseconds when the notification was created */
6668
6720
  createdAt: number;
6669
6721
  }
@@ -6696,6 +6748,18 @@ interface PartialLossAvailableNotification {
6696
6748
  priceOpen: number;
6697
6749
  /** Trade direction: "long" (buy) or "short" (sell) */
6698
6750
  position: "long" | "short";
6751
+ /** Effective take profit price (with trailing if set) */
6752
+ priceTakeProfit: number;
6753
+ /** Effective stop loss price (with trailing if set) */
6754
+ priceStopLoss: number;
6755
+ /** Original take profit price before any trailing adjustments */
6756
+ originalPriceTakeProfit: number;
6757
+ /** Original stop loss price before any trailing adjustments */
6758
+ originalPriceStopLoss: number;
6759
+ /** Signal creation timestamp in milliseconds (when signal was first created/scheduled) */
6760
+ scheduledAt: number;
6761
+ /** Pending timestamp in milliseconds (when position became pending/active at priceOpen) */
6762
+ pendingAt: number;
6699
6763
  /** Unix timestamp in milliseconds when the notification was created */
6700
6764
  createdAt: number;
6701
6765
  }
@@ -6726,6 +6790,18 @@ interface BreakevenAvailableNotification {
6726
6790
  priceOpen: number;
6727
6791
  /** Trade direction: "long" (buy) or "short" (sell) */
6728
6792
  position: "long" | "short";
6793
+ /** Effective take profit price (with trailing if set) */
6794
+ priceTakeProfit: number;
6795
+ /** Effective stop loss price (with trailing if set) */
6796
+ priceStopLoss: number;
6797
+ /** Original take profit price before any trailing adjustments */
6798
+ originalPriceTakeProfit: number;
6799
+ /** Original stop loss price before any trailing adjustments */
6800
+ originalPriceStopLoss: number;
6801
+ /** Signal creation timestamp in milliseconds (when signal was first created/scheduled) */
6802
+ scheduledAt: number;
6803
+ /** Pending timestamp in milliseconds (when position became pending/active at priceOpen) */
6804
+ pendingAt: number;
6729
6805
  /** Unix timestamp in milliseconds when the notification was created */
6730
6806
  createdAt: number;
6731
6807
  }
@@ -6752,6 +6828,22 @@ interface PartialProfitCommitNotification {
6752
6828
  percentToClose: number;
6753
6829
  /** Current market price when partial was executed */
6754
6830
  currentPrice: number;
6831
+ /** Trade direction: "long" (buy) or "short" (sell) */
6832
+ position: "long" | "short";
6833
+ /** Entry price for the position */
6834
+ priceOpen: number;
6835
+ /** Effective take profit price (with trailing if set) */
6836
+ priceTakeProfit: number;
6837
+ /** Effective stop loss price (with trailing if set) */
6838
+ priceStopLoss: number;
6839
+ /** Original take profit price before any trailing adjustments */
6840
+ originalPriceTakeProfit: number;
6841
+ /** Original stop loss price before any trailing adjustments */
6842
+ originalPriceStopLoss: number;
6843
+ /** Signal creation timestamp in milliseconds (when signal was first created/scheduled) */
6844
+ scheduledAt: number;
6845
+ /** Pending timestamp in milliseconds (when position became pending/active at priceOpen) */
6846
+ pendingAt: number;
6755
6847
  /** Unix timestamp in milliseconds when the notification was created */
6756
6848
  createdAt: number;
6757
6849
  }
@@ -6778,6 +6870,22 @@ interface PartialLossCommitNotification {
6778
6870
  percentToClose: number;
6779
6871
  /** Current market price when partial was executed */
6780
6872
  currentPrice: number;
6873
+ /** Trade direction: "long" (buy) or "short" (sell) */
6874
+ position: "long" | "short";
6875
+ /** Entry price for the position */
6876
+ priceOpen: number;
6877
+ /** Effective take profit price (with trailing if set) */
6878
+ priceTakeProfit: number;
6879
+ /** Effective stop loss price (with trailing if set) */
6880
+ priceStopLoss: number;
6881
+ /** Original take profit price before any trailing adjustments */
6882
+ originalPriceTakeProfit: number;
6883
+ /** Original stop loss price before any trailing adjustments */
6884
+ originalPriceStopLoss: number;
6885
+ /** Signal creation timestamp in milliseconds (when signal was first created/scheduled) */
6886
+ scheduledAt: number;
6887
+ /** Pending timestamp in milliseconds (when position became pending/active at priceOpen) */
6888
+ pendingAt: number;
6781
6889
  /** Unix timestamp in milliseconds when the notification was created */
6782
6890
  createdAt: number;
6783
6891
  }
@@ -6802,6 +6910,22 @@ interface BreakevenCommitNotification {
6802
6910
  exchangeName: ExchangeName;
6803
6911
  /** Current market price when breakeven was executed */
6804
6912
  currentPrice: number;
6913
+ /** Trade direction: "long" (buy) or "short" (sell) */
6914
+ position: "long" | "short";
6915
+ /** Entry price for the position */
6916
+ priceOpen: number;
6917
+ /** Effective take profit price (with trailing if set) */
6918
+ priceTakeProfit: number;
6919
+ /** Effective stop loss price (with trailing if set, after breakeven this equals priceOpen) */
6920
+ priceStopLoss: number;
6921
+ /** Original take profit price before any trailing adjustments */
6922
+ originalPriceTakeProfit: number;
6923
+ /** Original stop loss price before any trailing adjustments */
6924
+ originalPriceStopLoss: number;
6925
+ /** Signal creation timestamp in milliseconds (when signal was first created/scheduled) */
6926
+ scheduledAt: number;
6927
+ /** Pending timestamp in milliseconds (when position became pending/active at priceOpen) */
6928
+ pendingAt: number;
6805
6929
  /** Unix timestamp in milliseconds when the notification was created */
6806
6930
  createdAt: number;
6807
6931
  }
@@ -6828,6 +6952,22 @@ interface TrailingStopCommitNotification {
6828
6952
  percentShift: number;
6829
6953
  /** Current market price when trailing stop was executed */
6830
6954
  currentPrice: number;
6955
+ /** Trade direction: "long" (buy) or "short" (sell) */
6956
+ position: "long" | "short";
6957
+ /** Entry price for the position */
6958
+ priceOpen: number;
6959
+ /** Effective take profit price (with trailing if set) */
6960
+ priceTakeProfit: number;
6961
+ /** Effective stop loss price after trailing adjustment */
6962
+ priceStopLoss: number;
6963
+ /** Original take profit price before any trailing adjustments */
6964
+ originalPriceTakeProfit: number;
6965
+ /** Original stop loss price before any trailing adjustments */
6966
+ originalPriceStopLoss: number;
6967
+ /** Signal creation timestamp in milliseconds (when signal was first created/scheduled) */
6968
+ scheduledAt: number;
6969
+ /** Pending timestamp in milliseconds (when position became pending/active at priceOpen) */
6970
+ pendingAt: number;
6831
6971
  /** Unix timestamp in milliseconds when the notification was created */
6832
6972
  createdAt: number;
6833
6973
  }
@@ -6854,6 +6994,22 @@ interface TrailingTakeCommitNotification {
6854
6994
  percentShift: number;
6855
6995
  /** Current market price when trailing take was executed */
6856
6996
  currentPrice: number;
6997
+ /** Trade direction: "long" (buy) or "short" (sell) */
6998
+ position: "long" | "short";
6999
+ /** Entry price for the position */
7000
+ priceOpen: number;
7001
+ /** Effective take profit price after trailing adjustment */
7002
+ priceTakeProfit: number;
7003
+ /** Effective stop loss price (with trailing if set) */
7004
+ priceStopLoss: number;
7005
+ /** Original take profit price before any trailing adjustments */
7006
+ originalPriceTakeProfit: number;
7007
+ /** Original stop loss price before any trailing adjustments */
7008
+ originalPriceStopLoss: number;
7009
+ /** Signal creation timestamp in milliseconds (when signal was first created/scheduled) */
7010
+ scheduledAt: number;
7011
+ /** Pending timestamp in milliseconds (when position became pending/active at priceOpen) */
7012
+ pendingAt: number;
6857
7013
  /** Unix timestamp in milliseconds when the notification was created */
6858
7014
  createdAt: number;
6859
7015
  }
@@ -7471,6 +7627,22 @@ interface StrategyEvent {
7471
7627
  createdAt: string;
7472
7628
  /** True if backtest mode, false if live mode */
7473
7629
  backtest: boolean;
7630
+ /** Trade direction: "long" (buy) or "short" (sell) */
7631
+ position?: "long" | "short";
7632
+ /** Entry price for the position */
7633
+ priceOpen?: number;
7634
+ /** Effective take profit price (with trailing if set) */
7635
+ priceTakeProfit?: number;
7636
+ /** Effective stop loss price (with trailing if set) */
7637
+ priceStopLoss?: number;
7638
+ /** Original take profit price before any trailing adjustments */
7639
+ originalPriceTakeProfit?: number;
7640
+ /** Original stop loss price before any trailing adjustments */
7641
+ originalPriceStopLoss?: number;
7642
+ /** Signal creation timestamp in milliseconds (when signal was first created/scheduled) */
7643
+ scheduledAt?: number;
7644
+ /** Pending timestamp in milliseconds (when position became pending/active at priceOpen) */
7645
+ pendingAt?: number;
7474
7646
  }
7475
7647
  /**
7476
7648
  * Statistical data calculated from strategy events.
@@ -14101,12 +14273,20 @@ declare class StrategyMarkdownService {
14101
14273
  * @param isBacktest - Whether this is a backtest or live trading event
14102
14274
  * @param context - Strategy context with strategyName, exchangeName, frameName
14103
14275
  * @param timestamp - Timestamp from StrategyCommitContract (execution context time)
14276
+ * @param position - Trade direction: "long" or "short"
14277
+ * @param priceOpen - Entry price for the position
14278
+ * @param priceTakeProfit - Effective take profit price
14279
+ * @param priceStopLoss - Effective stop loss price
14280
+ * @param originalPriceTakeProfit - Original take profit before trailing
14281
+ * @param originalPriceStopLoss - Original stop loss before trailing
14282
+ * @param scheduledAt - Signal creation timestamp in milliseconds
14283
+ * @param pendingAt - Pending timestamp in milliseconds
14104
14284
  */
14105
14285
  partialProfit: (symbol: string, percentToClose: number, currentPrice: number, isBacktest: boolean, context: {
14106
14286
  strategyName: StrategyName;
14107
14287
  exchangeName: ExchangeName;
14108
14288
  frameName: FrameName;
14109
- }, timestamp: number) => Promise<void>;
14289
+ }, timestamp: number, position: "long" | "short", priceOpen: number, priceTakeProfit: number, priceStopLoss: number, originalPriceTakeProfit: number, originalPriceStopLoss: number, scheduledAt: number, pendingAt: number) => Promise<void>;
14110
14290
  /**
14111
14291
  * Records a partial-loss event when a portion of the position is closed at loss.
14112
14292
  *
@@ -14116,12 +14296,20 @@ declare class StrategyMarkdownService {
14116
14296
  * @param isBacktest - Whether this is a backtest or live trading event
14117
14297
  * @param context - Strategy context with strategyName, exchangeName, frameName
14118
14298
  * @param timestamp - Timestamp from StrategyCommitContract (execution context time)
14299
+ * @param position - Trade direction: "long" or "short"
14300
+ * @param priceOpen - Entry price for the position
14301
+ * @param priceTakeProfit - Effective take profit price
14302
+ * @param priceStopLoss - Effective stop loss price
14303
+ * @param originalPriceTakeProfit - Original take profit before trailing
14304
+ * @param originalPriceStopLoss - Original stop loss before trailing
14305
+ * @param scheduledAt - Signal creation timestamp in milliseconds
14306
+ * @param pendingAt - Pending timestamp in milliseconds
14119
14307
  */
14120
14308
  partialLoss: (symbol: string, percentToClose: number, currentPrice: number, isBacktest: boolean, context: {
14121
14309
  strategyName: StrategyName;
14122
14310
  exchangeName: ExchangeName;
14123
14311
  frameName: FrameName;
14124
- }, timestamp: number) => Promise<void>;
14312
+ }, timestamp: number, position: "long" | "short", priceOpen: number, priceTakeProfit: number, priceStopLoss: number, originalPriceTakeProfit: number, originalPriceStopLoss: number, scheduledAt: number, pendingAt: number) => Promise<void>;
14125
14313
  /**
14126
14314
  * Records a trailing-stop event when the stop-loss is adjusted.
14127
14315
  *
@@ -14131,12 +14319,20 @@ declare class StrategyMarkdownService {
14131
14319
  * @param isBacktest - Whether this is a backtest or live trading event
14132
14320
  * @param context - Strategy context with strategyName, exchangeName, frameName
14133
14321
  * @param timestamp - Timestamp from StrategyCommitContract (execution context time)
14322
+ * @param position - Trade direction: "long" or "short"
14323
+ * @param priceOpen - Entry price for the position
14324
+ * @param priceTakeProfit - Effective take profit price
14325
+ * @param priceStopLoss - Effective stop loss price
14326
+ * @param originalPriceTakeProfit - Original take profit before trailing
14327
+ * @param originalPriceStopLoss - Original stop loss before trailing
14328
+ * @param scheduledAt - Signal creation timestamp in milliseconds
14329
+ * @param pendingAt - Pending timestamp in milliseconds
14134
14330
  */
14135
14331
  trailingStop: (symbol: string, percentShift: number, currentPrice: number, isBacktest: boolean, context: {
14136
14332
  strategyName: StrategyName;
14137
14333
  exchangeName: ExchangeName;
14138
14334
  frameName: FrameName;
14139
- }, timestamp: number) => Promise<void>;
14335
+ }, timestamp: number, position: "long" | "short", priceOpen: number, priceTakeProfit: number, priceStopLoss: number, originalPriceTakeProfit: number, originalPriceStopLoss: number, scheduledAt: number, pendingAt: number) => Promise<void>;
14140
14336
  /**
14141
14337
  * Records a trailing-take event when the take-profit is adjusted.
14142
14338
  *
@@ -14146,12 +14342,20 @@ declare class StrategyMarkdownService {
14146
14342
  * @param isBacktest - Whether this is a backtest or live trading event
14147
14343
  * @param context - Strategy context with strategyName, exchangeName, frameName
14148
14344
  * @param timestamp - Timestamp from StrategyCommitContract (execution context time)
14345
+ * @param position - Trade direction: "long" or "short"
14346
+ * @param priceOpen - Entry price for the position
14347
+ * @param priceTakeProfit - Effective take profit price
14348
+ * @param priceStopLoss - Effective stop loss price
14349
+ * @param originalPriceTakeProfit - Original take profit before trailing
14350
+ * @param originalPriceStopLoss - Original stop loss before trailing
14351
+ * @param scheduledAt - Signal creation timestamp in milliseconds
14352
+ * @param pendingAt - Pending timestamp in milliseconds
14149
14353
  */
14150
14354
  trailingTake: (symbol: string, percentShift: number, currentPrice: number, isBacktest: boolean, context: {
14151
14355
  strategyName: StrategyName;
14152
14356
  exchangeName: ExchangeName;
14153
14357
  frameName: FrameName;
14154
- }, timestamp: number) => Promise<void>;
14358
+ }, timestamp: number, position: "long" | "short", priceOpen: number, priceTakeProfit: number, priceStopLoss: number, originalPriceTakeProfit: number, originalPriceStopLoss: number, scheduledAt: number, pendingAt: number) => Promise<void>;
14155
14359
  /**
14156
14360
  * Records a breakeven event when the stop-loss is moved to entry price.
14157
14361
  *
@@ -14160,12 +14364,20 @@ declare class StrategyMarkdownService {
14160
14364
  * @param isBacktest - Whether this is a backtest or live trading event
14161
14365
  * @param context - Strategy context with strategyName, exchangeName, frameName
14162
14366
  * @param timestamp - Timestamp from StrategyCommitContract (execution context time)
14367
+ * @param position - Trade direction: "long" or "short"
14368
+ * @param priceOpen - Entry price for the position
14369
+ * @param priceTakeProfit - Effective take profit price
14370
+ * @param priceStopLoss - Effective stop loss price
14371
+ * @param originalPriceTakeProfit - Original take profit before trailing
14372
+ * @param originalPriceStopLoss - Original stop loss before trailing
14373
+ * @param scheduledAt - Signal creation timestamp in milliseconds
14374
+ * @param pendingAt - Pending timestamp in milliseconds
14163
14375
  */
14164
14376
  breakeven: (symbol: string, currentPrice: number, isBacktest: boolean, context: {
14165
14377
  strategyName: StrategyName;
14166
14378
  exchangeName: ExchangeName;
14167
14379
  frameName: FrameName;
14168
- }, timestamp: number) => Promise<void>;
14380
+ }, timestamp: number, position: "long" | "short", priceOpen: number, priceTakeProfit: number, priceStopLoss: number, originalPriceTakeProfit: number, originalPriceStopLoss: number, scheduledAt: number, pendingAt: number) => Promise<void>;
14169
14381
  /**
14170
14382
  * Retrieves aggregated statistics from accumulated strategy events.
14171
14383
  *
@@ -19583,12 +19795,20 @@ declare class StrategyReportService {
19583
19795
  * @param isBacktest - Whether this is a backtest or live trading event
19584
19796
  * @param context - Strategy context with strategyName, exchangeName, frameName
19585
19797
  * @param timestamp - Timestamp from StrategyCommitContract (execution context time)
19798
+ * @param position - Trade direction: "long" or "short"
19799
+ * @param priceOpen - Entry price for the position
19800
+ * @param priceTakeProfit - Effective take profit price
19801
+ * @param priceStopLoss - Effective stop loss price
19802
+ * @param originalPriceTakeProfit - Original take profit before trailing
19803
+ * @param originalPriceStopLoss - Original stop loss before trailing
19804
+ * @param scheduledAt - Signal creation timestamp in milliseconds
19805
+ * @param pendingAt - Pending timestamp in milliseconds
19586
19806
  */
19587
19807
  partialProfit: (symbol: string, percentToClose: number, currentPrice: number, isBacktest: boolean, context: {
19588
19808
  strategyName: StrategyName;
19589
19809
  exchangeName: ExchangeName;
19590
19810
  frameName: FrameName;
19591
- }, timestamp: number) => Promise<void>;
19811
+ }, timestamp: number, position: "long" | "short", priceOpen: number, priceTakeProfit: number, priceStopLoss: number, originalPriceTakeProfit: number, originalPriceStopLoss: number, scheduledAt: number, pendingAt: number) => Promise<void>;
19592
19812
  /**
19593
19813
  * Logs a partial-loss event when a portion of the position is closed at loss.
19594
19814
  *
@@ -19598,12 +19818,20 @@ declare class StrategyReportService {
19598
19818
  * @param isBacktest - Whether this is a backtest or live trading event
19599
19819
  * @param context - Strategy context with strategyName, exchangeName, frameName
19600
19820
  * @param timestamp - Timestamp from StrategyCommitContract (execution context time)
19821
+ * @param position - Trade direction: "long" or "short"
19822
+ * @param priceOpen - Entry price for the position
19823
+ * @param priceTakeProfit - Effective take profit price
19824
+ * @param priceStopLoss - Effective stop loss price
19825
+ * @param originalPriceTakeProfit - Original take profit before trailing
19826
+ * @param originalPriceStopLoss - Original stop loss before trailing
19827
+ * @param scheduledAt - Signal creation timestamp in milliseconds
19828
+ * @param pendingAt - Pending timestamp in milliseconds
19601
19829
  */
19602
19830
  partialLoss: (symbol: string, percentToClose: number, currentPrice: number, isBacktest: boolean, context: {
19603
19831
  strategyName: StrategyName;
19604
19832
  exchangeName: ExchangeName;
19605
19833
  frameName: FrameName;
19606
- }, timestamp: number) => Promise<void>;
19834
+ }, timestamp: number, position: "long" | "short", priceOpen: number, priceTakeProfit: number, priceStopLoss: number, originalPriceTakeProfit: number, originalPriceStopLoss: number, scheduledAt: number, pendingAt: number) => Promise<void>;
19607
19835
  /**
19608
19836
  * Logs a trailing-stop event when the stop-loss is adjusted.
19609
19837
  *
@@ -19613,12 +19841,20 @@ declare class StrategyReportService {
19613
19841
  * @param isBacktest - Whether this is a backtest or live trading event
19614
19842
  * @param context - Strategy context with strategyName, exchangeName, frameName
19615
19843
  * @param timestamp - Timestamp from StrategyCommitContract (execution context time)
19844
+ * @param position - Trade direction: "long" or "short"
19845
+ * @param priceOpen - Entry price for the position
19846
+ * @param priceTakeProfit - Effective take profit price
19847
+ * @param priceStopLoss - Effective stop loss price
19848
+ * @param originalPriceTakeProfit - Original take profit before trailing
19849
+ * @param originalPriceStopLoss - Original stop loss before trailing
19850
+ * @param scheduledAt - Signal creation timestamp in milliseconds
19851
+ * @param pendingAt - Pending timestamp in milliseconds
19616
19852
  */
19617
19853
  trailingStop: (symbol: string, percentShift: number, currentPrice: number, isBacktest: boolean, context: {
19618
19854
  strategyName: StrategyName;
19619
19855
  exchangeName: ExchangeName;
19620
19856
  frameName: FrameName;
19621
- }, timestamp: number) => Promise<void>;
19857
+ }, timestamp: number, position: "long" | "short", priceOpen: number, priceTakeProfit: number, priceStopLoss: number, originalPriceTakeProfit: number, originalPriceStopLoss: number, scheduledAt: number, pendingAt: number) => Promise<void>;
19622
19858
  /**
19623
19859
  * Logs a trailing-take event when the take-profit is adjusted.
19624
19860
  *
@@ -19628,12 +19864,20 @@ declare class StrategyReportService {
19628
19864
  * @param isBacktest - Whether this is a backtest or live trading event
19629
19865
  * @param context - Strategy context with strategyName, exchangeName, frameName
19630
19866
  * @param timestamp - Timestamp from StrategyCommitContract (execution context time)
19867
+ * @param position - Trade direction: "long" or "short"
19868
+ * @param priceOpen - Entry price for the position
19869
+ * @param priceTakeProfit - Effective take profit price
19870
+ * @param priceStopLoss - Effective stop loss price
19871
+ * @param originalPriceTakeProfit - Original take profit before trailing
19872
+ * @param originalPriceStopLoss - Original stop loss before trailing
19873
+ * @param scheduledAt - Signal creation timestamp in milliseconds
19874
+ * @param pendingAt - Pending timestamp in milliseconds
19631
19875
  */
19632
19876
  trailingTake: (symbol: string, percentShift: number, currentPrice: number, isBacktest: boolean, context: {
19633
19877
  strategyName: StrategyName;
19634
19878
  exchangeName: ExchangeName;
19635
19879
  frameName: FrameName;
19636
- }, timestamp: number) => Promise<void>;
19880
+ }, timestamp: number, position: "long" | "short", priceOpen: number, priceTakeProfit: number, priceStopLoss: number, originalPriceTakeProfit: number, originalPriceStopLoss: number, scheduledAt: number, pendingAt: number) => Promise<void>;
19637
19881
  /**
19638
19882
  * Logs a breakeven event when the stop-loss is moved to entry price.
19639
19883
  *
@@ -19642,12 +19886,20 @@ declare class StrategyReportService {
19642
19886
  * @param isBacktest - Whether this is a backtest or live trading event
19643
19887
  * @param context - Strategy context with strategyName, exchangeName, frameName
19644
19888
  * @param timestamp - Timestamp from StrategyCommitContract (execution context time)
19889
+ * @param position - Trade direction: "long" or "short"
19890
+ * @param priceOpen - Entry price for the position
19891
+ * @param priceTakeProfit - Effective take profit price
19892
+ * @param priceStopLoss - Effective stop loss price
19893
+ * @param originalPriceTakeProfit - Original take profit before trailing
19894
+ * @param originalPriceStopLoss - Original stop loss before trailing
19895
+ * @param scheduledAt - Signal creation timestamp in milliseconds
19896
+ * @param pendingAt - Pending timestamp in milliseconds
19645
19897
  */
19646
19898
  breakeven: (symbol: string, currentPrice: number, isBacktest: boolean, context: {
19647
19899
  strategyName: StrategyName;
19648
19900
  exchangeName: ExchangeName;
19649
19901
  frameName: FrameName;
19650
- }, timestamp: number) => Promise<void>;
19902
+ }, timestamp: number, position: "long" | "short", priceOpen: number, priceTakeProfit: number, priceStopLoss: number, originalPriceTakeProfit: number, originalPriceStopLoss: number, scheduledAt: number, pendingAt: number) => Promise<void>;
19651
19903
  /**
19652
19904
  * Initializes the service for event logging.
19653
19905
  *