backtest-kit 11.8.0 → 11.9.0
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/LICENSE +21 -21
- package/README.md +1996 -1996
- package/build/index.cjs +247 -81
- package/build/index.mjs +247 -82
- package/package.json +86 -86
- package/types.d.ts +136 -40
package/build/index.mjs
CHANGED
|
@@ -4661,7 +4661,7 @@ const LOGGER_SERVICE$8 = new LoggerService();
|
|
|
4661
4661
|
* @param backtest - `true` for backtest, `false` for live.
|
|
4662
4662
|
* @returns Colon-joined composite key.
|
|
4663
4663
|
*/
|
|
4664
|
-
const CREATE_KEY_FN$
|
|
4664
|
+
const CREATE_KEY_FN$B = (symbol, strategyName, exchangeName, frameName, backtest) => {
|
|
4665
4665
|
const parts = [symbol, strategyName, exchangeName];
|
|
4666
4666
|
if (frameName)
|
|
4667
4667
|
parts.push(frameName);
|
|
@@ -4704,7 +4704,7 @@ class LookupUtils {
|
|
|
4704
4704
|
LOGGER_SERVICE$8.info(METHOD_NAME_ADD_ACTIVITY, {
|
|
4705
4705
|
activity,
|
|
4706
4706
|
});
|
|
4707
|
-
const key = CREATE_KEY_FN$
|
|
4707
|
+
const key = CREATE_KEY_FN$B(activity.symbol, activity.context.strategyName, activity.context.exchangeName, activity.context.frameName, activity.backtest);
|
|
4708
4708
|
this._lookupMap.set(key, activity);
|
|
4709
4709
|
};
|
|
4710
4710
|
/**
|
|
@@ -4718,7 +4718,7 @@ class LookupUtils {
|
|
|
4718
4718
|
LOGGER_SERVICE$8.info(METHOD_NAME_REMOVE_ACTIVITY, {
|
|
4719
4719
|
activity,
|
|
4720
4720
|
});
|
|
4721
|
-
const key = CREATE_KEY_FN$
|
|
4721
|
+
const key = CREATE_KEY_FN$B(activity.symbol, activity.context.strategyName, activity.context.exchangeName, activity.context.frameName, activity.backtest);
|
|
4722
4722
|
this._lookupMap.delete(key);
|
|
4723
4723
|
};
|
|
4724
4724
|
/**
|
|
@@ -12336,7 +12336,7 @@ const GET_RISK_FN = (dto, backtest, exchangeName, frameName, self) => {
|
|
|
12336
12336
|
* @param backtest - Whether running in backtest mode
|
|
12337
12337
|
* @returns Unique string key for memoization
|
|
12338
12338
|
*/
|
|
12339
|
-
const CREATE_KEY_FN$
|
|
12339
|
+
const CREATE_KEY_FN$A = (symbol, strategyName, exchangeName, frameName, backtest) => {
|
|
12340
12340
|
const parts = [symbol, strategyName, exchangeName];
|
|
12341
12341
|
if (frameName)
|
|
12342
12342
|
parts.push(frameName);
|
|
@@ -12638,7 +12638,7 @@ class StrategyConnectionService {
|
|
|
12638
12638
|
* @param backtest - Whether running in backtest mode
|
|
12639
12639
|
* @returns Configured ClientStrategy instance
|
|
12640
12640
|
*/
|
|
12641
|
-
this.getStrategy = memoize(([symbol, strategyName, exchangeName, frameName, backtest]) => CREATE_KEY_FN$
|
|
12641
|
+
this.getStrategy = memoize(([symbol, strategyName, exchangeName, frameName, backtest]) => CREATE_KEY_FN$A(symbol, strategyName, exchangeName, frameName, backtest), (symbol, strategyName, exchangeName, frameName, backtest) => {
|
|
12642
12642
|
const { riskName = "", riskList = [], getSignal, interval = STRATEGY_DEFAULT_INTERVAL, callbacks, } = this.strategySchemaService.get(strategyName);
|
|
12643
12643
|
return new ClientStrategy({
|
|
12644
12644
|
symbol,
|
|
@@ -13600,7 +13600,7 @@ class StrategyConnectionService {
|
|
|
13600
13600
|
}
|
|
13601
13601
|
return;
|
|
13602
13602
|
}
|
|
13603
|
-
const key = CREATE_KEY_FN$
|
|
13603
|
+
const key = CREATE_KEY_FN$A(payload.symbol, payload.strategyName, payload.exchangeName, payload.frameName, payload.backtest);
|
|
13604
13604
|
if (!this.getStrategy.has(key)) {
|
|
13605
13605
|
return;
|
|
13606
13606
|
}
|
|
@@ -14146,6 +14146,7 @@ class ClientFrame {
|
|
|
14146
14146
|
}
|
|
14147
14147
|
}
|
|
14148
14148
|
|
|
14149
|
+
const DEFAULT_INTERVAL = "1m";
|
|
14149
14150
|
/**
|
|
14150
14151
|
* Connection service routing frame operations to correct ClientFrame instance.
|
|
14151
14152
|
*
|
|
@@ -14189,7 +14190,7 @@ class FrameConnectionService {
|
|
|
14189
14190
|
logger: this.loggerService,
|
|
14190
14191
|
startDate,
|
|
14191
14192
|
endDate,
|
|
14192
|
-
interval,
|
|
14193
|
+
interval: interval || DEFAULT_INTERVAL,
|
|
14193
14194
|
callbacks,
|
|
14194
14195
|
});
|
|
14195
14196
|
});
|
|
@@ -14848,7 +14849,7 @@ class ClientRisk {
|
|
|
14848
14849
|
* @param backtest - Whether running in backtest mode
|
|
14849
14850
|
* @returns Unique string key for memoization
|
|
14850
14851
|
*/
|
|
14851
|
-
const CREATE_KEY_FN$
|
|
14852
|
+
const CREATE_KEY_FN$z = (riskName, exchangeName, frameName, backtest) => {
|
|
14852
14853
|
const parts = [riskName, exchangeName];
|
|
14853
14854
|
if (frameName)
|
|
14854
14855
|
parts.push(frameName);
|
|
@@ -14948,7 +14949,7 @@ class RiskConnectionService {
|
|
|
14948
14949
|
* @param backtest - True if backtest mode, false if live mode
|
|
14949
14950
|
* @returns Configured ClientRisk instance
|
|
14950
14951
|
*/
|
|
14951
|
-
this.getRisk = memoize(([riskName, exchangeName, frameName, backtest]) => CREATE_KEY_FN$
|
|
14952
|
+
this.getRisk = memoize(([riskName, exchangeName, frameName, backtest]) => CREATE_KEY_FN$z(riskName, exchangeName, frameName, backtest), (riskName, exchangeName, frameName, backtest) => {
|
|
14952
14953
|
const schema = this.riskSchemaService.get(riskName);
|
|
14953
14954
|
return new ClientRisk({
|
|
14954
14955
|
...schema,
|
|
@@ -15038,7 +15039,7 @@ class RiskConnectionService {
|
|
|
15038
15039
|
payload,
|
|
15039
15040
|
});
|
|
15040
15041
|
if (payload) {
|
|
15041
|
-
const key = CREATE_KEY_FN$
|
|
15042
|
+
const key = CREATE_KEY_FN$z(payload.riskName, payload.exchangeName, payload.frameName, payload.backtest);
|
|
15042
15043
|
this.getRisk.clear(key);
|
|
15043
15044
|
}
|
|
15044
15045
|
else {
|
|
@@ -16157,7 +16158,7 @@ class ClientAction {
|
|
|
16157
16158
|
* @param backtest - Whether running in backtest mode
|
|
16158
16159
|
* @returns Unique string key for memoization
|
|
16159
16160
|
*/
|
|
16160
|
-
const CREATE_KEY_FN$
|
|
16161
|
+
const CREATE_KEY_FN$y = (actionName, strategyName, exchangeName, frameName, backtest) => {
|
|
16161
16162
|
const parts = [actionName, strategyName, exchangeName];
|
|
16162
16163
|
if (frameName)
|
|
16163
16164
|
parts.push(frameName);
|
|
@@ -16209,7 +16210,7 @@ class ActionConnectionService {
|
|
|
16209
16210
|
* @param backtest - True if backtest mode, false if live mode
|
|
16210
16211
|
* @returns Configured ClientAction instance
|
|
16211
16212
|
*/
|
|
16212
|
-
this.getAction = memoize(([actionName, strategyName, exchangeName, frameName, backtest]) => CREATE_KEY_FN$
|
|
16213
|
+
this.getAction = memoize(([actionName, strategyName, exchangeName, frameName, backtest]) => CREATE_KEY_FN$y(actionName, strategyName, exchangeName, frameName, backtest), (actionName, strategyName, exchangeName, frameName, backtest) => {
|
|
16213
16214
|
const schema = this.actionSchemaService.get(actionName);
|
|
16214
16215
|
return new ClientAction({
|
|
16215
16216
|
...schema,
|
|
@@ -16435,7 +16436,7 @@ class ActionConnectionService {
|
|
|
16435
16436
|
await Promise.all(actions.map(async (action) => await action.dispose()));
|
|
16436
16437
|
return;
|
|
16437
16438
|
}
|
|
16438
|
-
const key = CREATE_KEY_FN$
|
|
16439
|
+
const key = CREATE_KEY_FN$y(payload.actionName, payload.strategyName, payload.exchangeName, payload.frameName, payload.backtest);
|
|
16439
16440
|
if (!this.getAction.has(key)) {
|
|
16440
16441
|
return;
|
|
16441
16442
|
}
|
|
@@ -16446,14 +16447,14 @@ class ActionConnectionService {
|
|
|
16446
16447
|
}
|
|
16447
16448
|
}
|
|
16448
16449
|
|
|
16449
|
-
const METHOD_NAME_VALIDATE$
|
|
16450
|
+
const METHOD_NAME_VALIDATE$6 = "exchangeCoreService validate";
|
|
16450
16451
|
/**
|
|
16451
16452
|
* Creates a unique key for memoizing validate calls.
|
|
16452
16453
|
* Key format: "exchangeName"
|
|
16453
16454
|
* @param exchangeName - Exchange name
|
|
16454
16455
|
* @returns Unique string key for memoization
|
|
16455
16456
|
*/
|
|
16456
|
-
const CREATE_KEY_FN$
|
|
16457
|
+
const CREATE_KEY_FN$x = (exchangeName) => {
|
|
16457
16458
|
return exchangeName;
|
|
16458
16459
|
};
|
|
16459
16460
|
/**
|
|
@@ -16477,11 +16478,11 @@ class ExchangeCoreService {
|
|
|
16477
16478
|
* @param exchangeName - Name of the exchange to validate
|
|
16478
16479
|
* @returns Promise that resolves when validation is complete
|
|
16479
16480
|
*/
|
|
16480
|
-
this.validate = memoize(([exchangeName]) => CREATE_KEY_FN$
|
|
16481
|
-
this.loggerService.log(METHOD_NAME_VALIDATE$
|
|
16481
|
+
this.validate = memoize(([exchangeName]) => CREATE_KEY_FN$x(exchangeName), async (exchangeName) => {
|
|
16482
|
+
this.loggerService.log(METHOD_NAME_VALIDATE$6, {
|
|
16482
16483
|
exchangeName,
|
|
16483
16484
|
});
|
|
16484
|
-
this.exchangeValidationService.validate(exchangeName, METHOD_NAME_VALIDATE$
|
|
16485
|
+
this.exchangeValidationService.validate(exchangeName, METHOD_NAME_VALIDATE$6);
|
|
16485
16486
|
});
|
|
16486
16487
|
/**
|
|
16487
16488
|
* Fetches historical candles with execution context.
|
|
@@ -16750,14 +16751,14 @@ class ExchangeCoreService {
|
|
|
16750
16751
|
}
|
|
16751
16752
|
}
|
|
16752
16753
|
|
|
16753
|
-
const METHOD_NAME_VALIDATE$
|
|
16754
|
+
const METHOD_NAME_VALIDATE$5 = "strategyCoreService validate";
|
|
16754
16755
|
/**
|
|
16755
16756
|
* Creates a unique key for memoizing validate calls.
|
|
16756
16757
|
* Key format: "strategyName:exchangeName:frameName"
|
|
16757
16758
|
* @param context - Execution context with strategyName, exchangeName, frameName
|
|
16758
16759
|
* @returns Unique string key for memoization
|
|
16759
16760
|
*/
|
|
16760
|
-
const CREATE_KEY_FN$
|
|
16761
|
+
const CREATE_KEY_FN$w = (context) => {
|
|
16761
16762
|
const parts = [context.strategyName, context.exchangeName];
|
|
16762
16763
|
if (context.frameName)
|
|
16763
16764
|
parts.push(context.frameName);
|
|
@@ -16780,6 +16781,7 @@ class StrategyCoreService {
|
|
|
16780
16781
|
this.strategyValidationService = inject(TYPES.strategyValidationService);
|
|
16781
16782
|
this.exchangeValidationService = inject(TYPES.exchangeValidationService);
|
|
16782
16783
|
this.frameValidationService = inject(TYPES.frameValidationService);
|
|
16784
|
+
this.actionValidationService = inject(TYPES.actionValidationService);
|
|
16783
16785
|
/**
|
|
16784
16786
|
* Validates strategy and associated risk configuration.
|
|
16785
16787
|
*
|
|
@@ -16789,16 +16791,17 @@ class StrategyCoreService {
|
|
|
16789
16791
|
* @param context - Execution context with strategyName, exchangeName, frameName
|
|
16790
16792
|
* @returns Promise that resolves when validation is complete
|
|
16791
16793
|
*/
|
|
16792
|
-
this.validate = memoize(([context]) => CREATE_KEY_FN$
|
|
16793
|
-
this.loggerService.log(METHOD_NAME_VALIDATE$
|
|
16794
|
+
this.validate = memoize(([context]) => CREATE_KEY_FN$w(context), async (context) => {
|
|
16795
|
+
this.loggerService.log(METHOD_NAME_VALIDATE$5, {
|
|
16794
16796
|
context,
|
|
16795
16797
|
});
|
|
16796
|
-
const { riskName, riskList } = this.strategySchemaService.get(context.strategyName);
|
|
16797
|
-
this.strategyValidationService.validate(context.strategyName, METHOD_NAME_VALIDATE$
|
|
16798
|
-
this.exchangeValidationService.validate(context.exchangeName, METHOD_NAME_VALIDATE$
|
|
16799
|
-
context.frameName && this.frameValidationService.validate(context.frameName, METHOD_NAME_VALIDATE$
|
|
16800
|
-
riskName && this.riskValidationService.validate(riskName, METHOD_NAME_VALIDATE$
|
|
16801
|
-
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, METHOD_NAME_VALIDATE$
|
|
16798
|
+
const { riskName, riskList, actions } = this.strategySchemaService.get(context.strategyName);
|
|
16799
|
+
this.strategyValidationService.validate(context.strategyName, METHOD_NAME_VALIDATE$5);
|
|
16800
|
+
this.exchangeValidationService.validate(context.exchangeName, METHOD_NAME_VALIDATE$5);
|
|
16801
|
+
context.frameName && this.frameValidationService.validate(context.frameName, METHOD_NAME_VALIDATE$5);
|
|
16802
|
+
riskName && this.riskValidationService.validate(riskName, METHOD_NAME_VALIDATE$5);
|
|
16803
|
+
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, METHOD_NAME_VALIDATE$5));
|
|
16804
|
+
actions && actions.forEach((actionName) => this.actionValidationService.validate(actionName, METHOD_NAME_VALIDATE$5));
|
|
16802
16805
|
});
|
|
16803
16806
|
/**
|
|
16804
16807
|
* Retrieves the currently active pending signal for the symbol.
|
|
@@ -18159,7 +18162,7 @@ class SizingGlobalService {
|
|
|
18159
18162
|
* @param context - Context with riskName, exchangeName, frameName
|
|
18160
18163
|
* @returns Unique string key for memoization
|
|
18161
18164
|
*/
|
|
18162
|
-
const CREATE_KEY_FN$
|
|
18165
|
+
const CREATE_KEY_FN$v = (context) => {
|
|
18163
18166
|
const parts = [context.riskName, context.exchangeName];
|
|
18164
18167
|
if (context.frameName)
|
|
18165
18168
|
parts.push(context.frameName);
|
|
@@ -18185,7 +18188,7 @@ class RiskGlobalService {
|
|
|
18185
18188
|
* @param payload - Payload with riskName, exchangeName and frameName
|
|
18186
18189
|
* @returns Promise that resolves when validation is complete
|
|
18187
18190
|
*/
|
|
18188
|
-
this.validate = memoize(([context]) => CREATE_KEY_FN$
|
|
18191
|
+
this.validate = memoize(([context]) => CREATE_KEY_FN$v(context), async (context) => {
|
|
18189
18192
|
this.loggerService.log("riskGlobalService validate", {
|
|
18190
18193
|
context,
|
|
18191
18194
|
});
|
|
@@ -18277,14 +18280,14 @@ class RiskGlobalService {
|
|
|
18277
18280
|
}
|
|
18278
18281
|
}
|
|
18279
18282
|
|
|
18280
|
-
const METHOD_NAME_VALIDATE$
|
|
18283
|
+
const METHOD_NAME_VALIDATE$4 = "actionCoreService validate";
|
|
18281
18284
|
/**
|
|
18282
18285
|
* Creates a unique key for memoizing validate calls.
|
|
18283
18286
|
* Key format: "strategyName:exchangeName:frameName"
|
|
18284
18287
|
* @param context - Execution context with strategyName, exchangeName, frameName
|
|
18285
18288
|
* @returns Unique string key for memoization
|
|
18286
18289
|
*/
|
|
18287
|
-
const CREATE_KEY_FN$
|
|
18290
|
+
const CREATE_KEY_FN$u = (context) => {
|
|
18288
18291
|
const parts = [context.strategyName, context.exchangeName];
|
|
18289
18292
|
if (context.frameName)
|
|
18290
18293
|
parts.push(context.frameName);
|
|
@@ -18328,17 +18331,17 @@ class ActionCoreService {
|
|
|
18328
18331
|
* @param context - Strategy execution context with strategyName, exchangeName and frameName
|
|
18329
18332
|
* @returns Promise that resolves when all validations complete
|
|
18330
18333
|
*/
|
|
18331
|
-
this.validate = memoize(([context]) => CREATE_KEY_FN$
|
|
18332
|
-
this.loggerService.log(METHOD_NAME_VALIDATE$
|
|
18334
|
+
this.validate = memoize(([context]) => CREATE_KEY_FN$u(context), async (context) => {
|
|
18335
|
+
this.loggerService.log(METHOD_NAME_VALIDATE$4, {
|
|
18333
18336
|
context,
|
|
18334
18337
|
});
|
|
18335
18338
|
const { riskName, riskList, actions } = this.strategySchemaService.get(context.strategyName);
|
|
18336
|
-
this.strategyValidationService.validate(context.strategyName, METHOD_NAME_VALIDATE$
|
|
18337
|
-
this.exchangeValidationService.validate(context.exchangeName, METHOD_NAME_VALIDATE$
|
|
18338
|
-
context.frameName && this.frameValidationService.validate(context.frameName, METHOD_NAME_VALIDATE$
|
|
18339
|
-
riskName && this.riskValidationService.validate(riskName, METHOD_NAME_VALIDATE$
|
|
18340
|
-
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, METHOD_NAME_VALIDATE$
|
|
18341
|
-
actions && actions.forEach((actionName) => this.actionValidationService.validate(actionName, METHOD_NAME_VALIDATE$
|
|
18339
|
+
this.strategyValidationService.validate(context.strategyName, METHOD_NAME_VALIDATE$4);
|
|
18340
|
+
this.exchangeValidationService.validate(context.exchangeName, METHOD_NAME_VALIDATE$4);
|
|
18341
|
+
context.frameName && this.frameValidationService.validate(context.frameName, METHOD_NAME_VALIDATE$4);
|
|
18342
|
+
riskName && this.riskValidationService.validate(riskName, METHOD_NAME_VALIDATE$4);
|
|
18343
|
+
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, METHOD_NAME_VALIDATE$4));
|
|
18344
|
+
actions && actions.forEach((actionName) => this.actionValidationService.validate(actionName, METHOD_NAME_VALIDATE$4));
|
|
18342
18345
|
});
|
|
18343
18346
|
/**
|
|
18344
18347
|
* Initializes all ClientAction instances for the strategy.
|
|
@@ -18834,8 +18837,8 @@ class FrameSchemaService {
|
|
|
18834
18837
|
if (typeof frameSchema.frameName !== "string") {
|
|
18835
18838
|
throw new Error(`frame schema validation failed: missing frameName`);
|
|
18836
18839
|
}
|
|
18837
|
-
if (typeof frameSchema.interval !== "string") {
|
|
18838
|
-
throw new Error(`frame schema validation failed:
|
|
18840
|
+
if (frameSchema.interval && typeof frameSchema.interval !== "string") {
|
|
18841
|
+
throw new Error(`frame schema validation failed: invalid interval for frameName=${frameSchema.frameName}`);
|
|
18839
18842
|
}
|
|
18840
18843
|
if (!(frameSchema.startDate instanceof Date)) {
|
|
18841
18844
|
throw new Error(`frame schema validation failed: missing startDate for frameName=${frameSchema.frameName}`);
|
|
@@ -20828,6 +20831,17 @@ class WalkerLogicPublicService {
|
|
|
20828
20831
|
}
|
|
20829
20832
|
|
|
20830
20833
|
const METHOD_NAME_RUN$2 = "liveCommandService run";
|
|
20834
|
+
const METHOD_NAME_VALIDATE$3 = "liveCommandService validate";
|
|
20835
|
+
/**
|
|
20836
|
+
* Creates a unique key for memoizing validate calls.
|
|
20837
|
+
* Key format: "strategyName:exchangeName:frameName"
|
|
20838
|
+
* @param context - Context with strategyName, exchangeName, frameName
|
|
20839
|
+
* @returns Unique string key for memoization
|
|
20840
|
+
*/
|
|
20841
|
+
const CREATE_KEY_FN$t = (context) => {
|
|
20842
|
+
const parts = [context.strategyName, context.exchangeName];
|
|
20843
|
+
return parts.join(":");
|
|
20844
|
+
};
|
|
20831
20845
|
/**
|
|
20832
20846
|
* Global service providing access to live trading functionality.
|
|
20833
20847
|
*
|
|
@@ -20843,6 +20857,25 @@ class LiveCommandService {
|
|
|
20843
20857
|
this.strategySchemaService = inject(TYPES.strategySchemaService);
|
|
20844
20858
|
this.riskValidationService = inject(TYPES.riskValidationService);
|
|
20845
20859
|
this.actionValidationService = inject(TYPES.actionValidationService);
|
|
20860
|
+
/**
|
|
20861
|
+
* Validates strategy and associated risk configuration.
|
|
20862
|
+
* Memoized to avoid redundant validations for the same strategy-exchange combination.
|
|
20863
|
+
*
|
|
20864
|
+
* @param context - Context with strategyName, exchangeName
|
|
20865
|
+
* @param methodName - Name of the calling method for error tracking
|
|
20866
|
+
*/
|
|
20867
|
+
this.validate = memoize(([context]) => CREATE_KEY_FN$t(context), (context, methodName) => {
|
|
20868
|
+
this.loggerService.log(METHOD_NAME_VALIDATE$3, {
|
|
20869
|
+
context,
|
|
20870
|
+
methodName,
|
|
20871
|
+
});
|
|
20872
|
+
this.strategyValidationService.validate(context.strategyName, methodName);
|
|
20873
|
+
this.exchangeValidationService.validate(context.exchangeName, methodName);
|
|
20874
|
+
const { riskName, riskList, actions } = this.strategySchemaService.get(context.strategyName);
|
|
20875
|
+
riskName && this.riskValidationService.validate(riskName, methodName);
|
|
20876
|
+
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, methodName));
|
|
20877
|
+
actions && actions.forEach((actionName) => this.actionValidationService.validate(actionName, methodName));
|
|
20878
|
+
});
|
|
20846
20879
|
/**
|
|
20847
20880
|
* Runs live trading for a symbol with context propagation.
|
|
20848
20881
|
*
|
|
@@ -20857,22 +20890,26 @@ class LiveCommandService {
|
|
|
20857
20890
|
symbol,
|
|
20858
20891
|
context,
|
|
20859
20892
|
});
|
|
20860
|
-
|
|
20861
|
-
this.strategyValidationService.validate(context.strategyName, METHOD_NAME_RUN$2);
|
|
20862
|
-
this.exchangeValidationService.validate(context.exchangeName, METHOD_NAME_RUN$2);
|
|
20863
|
-
}
|
|
20864
|
-
{
|
|
20865
|
-
const { riskName, riskList, actions } = this.strategySchemaService.get(context.strategyName);
|
|
20866
|
-
riskName && this.riskValidationService.validate(riskName, METHOD_NAME_RUN$2);
|
|
20867
|
-
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, METHOD_NAME_RUN$2));
|
|
20868
|
-
actions && actions.forEach((actionName) => this.actionValidationService.validate(actionName, METHOD_NAME_RUN$2));
|
|
20869
|
-
}
|
|
20893
|
+
this.validate(context, METHOD_NAME_RUN$2);
|
|
20870
20894
|
return this.liveLogicPublicService.run(symbol, context);
|
|
20871
20895
|
};
|
|
20872
20896
|
}
|
|
20873
20897
|
}
|
|
20874
20898
|
|
|
20875
20899
|
const METHOD_NAME_RUN$1 = "backtestCommandService run";
|
|
20900
|
+
const METHOD_NAME_VALIDATE$2 = "backtestCommandService validate";
|
|
20901
|
+
/**
|
|
20902
|
+
* Creates a unique key for memoizing validate calls.
|
|
20903
|
+
* Key format: "strategyName:exchangeName:frameName"
|
|
20904
|
+
* @param context - Context with strategyName, exchangeName, frameName
|
|
20905
|
+
* @returns Unique string key for memoization
|
|
20906
|
+
*/
|
|
20907
|
+
const CREATE_KEY_FN$s = (context) => {
|
|
20908
|
+
const parts = [context.strategyName, context.exchangeName];
|
|
20909
|
+
if (context.frameName)
|
|
20910
|
+
parts.push(context.frameName);
|
|
20911
|
+
return parts.join(":");
|
|
20912
|
+
};
|
|
20876
20913
|
/**
|
|
20877
20914
|
* Global service providing access to backtest functionality.
|
|
20878
20915
|
*
|
|
@@ -20889,6 +20926,26 @@ class BacktestCommandService {
|
|
|
20889
20926
|
this.strategyValidationService = inject(TYPES.strategyValidationService);
|
|
20890
20927
|
this.exchangeValidationService = inject(TYPES.exchangeValidationService);
|
|
20891
20928
|
this.frameValidationService = inject(TYPES.frameValidationService);
|
|
20929
|
+
/**
|
|
20930
|
+
* Validates strategy and associated risk configuration.
|
|
20931
|
+
* Memoized to avoid redundant validations for the same strategy-exchange-frame combination.
|
|
20932
|
+
*
|
|
20933
|
+
* @param context - Context with strategyName, exchangeName and frameName
|
|
20934
|
+
* @param methodName - Name of the calling method for error tracking
|
|
20935
|
+
*/
|
|
20936
|
+
this.validate = memoize(([context]) => CREATE_KEY_FN$s(context), (context, methodName) => {
|
|
20937
|
+
this.loggerService.log(METHOD_NAME_VALIDATE$2, {
|
|
20938
|
+
context,
|
|
20939
|
+
methodName,
|
|
20940
|
+
});
|
|
20941
|
+
this.strategyValidationService.validate(context.strategyName, methodName);
|
|
20942
|
+
this.exchangeValidationService.validate(context.exchangeName, methodName);
|
|
20943
|
+
this.frameValidationService.validate(context.frameName, methodName);
|
|
20944
|
+
const { riskName, riskList, actions } = this.strategySchemaService.get(context.strategyName);
|
|
20945
|
+
riskName && this.riskValidationService.validate(riskName, methodName);
|
|
20946
|
+
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, methodName));
|
|
20947
|
+
actions && actions.forEach((actionName) => this.actionValidationService.validate(actionName, methodName));
|
|
20948
|
+
});
|
|
20892
20949
|
/**
|
|
20893
20950
|
* Runs backtest for a symbol with context propagation.
|
|
20894
20951
|
*
|
|
@@ -20901,23 +20958,26 @@ class BacktestCommandService {
|
|
|
20901
20958
|
symbol,
|
|
20902
20959
|
context,
|
|
20903
20960
|
});
|
|
20904
|
-
|
|
20905
|
-
this.strategyValidationService.validate(context.strategyName, METHOD_NAME_RUN$1);
|
|
20906
|
-
this.exchangeValidationService.validate(context.exchangeName, METHOD_NAME_RUN$1);
|
|
20907
|
-
this.frameValidationService.validate(context.frameName, METHOD_NAME_RUN$1);
|
|
20908
|
-
}
|
|
20909
|
-
{
|
|
20910
|
-
const { riskName, riskList, actions } = this.strategySchemaService.get(context.strategyName);
|
|
20911
|
-
riskName && this.riskValidationService.validate(riskName, METHOD_NAME_RUN$1);
|
|
20912
|
-
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, METHOD_NAME_RUN$1));
|
|
20913
|
-
actions && actions.forEach((actionName) => this.actionValidationService.validate(actionName, METHOD_NAME_RUN$1));
|
|
20914
|
-
}
|
|
20961
|
+
this.validate(context, METHOD_NAME_RUN$1);
|
|
20915
20962
|
return this.backtestLogicPublicService.run(symbol, context);
|
|
20916
20963
|
};
|
|
20917
20964
|
}
|
|
20918
20965
|
}
|
|
20919
20966
|
|
|
20920
20967
|
const METHOD_NAME_RUN = "walkerCommandService run";
|
|
20968
|
+
const METHOD_NAME_VALIDATE$1 = "walkerCommandService validate";
|
|
20969
|
+
/**
|
|
20970
|
+
* Creates a unique key for memoizing validate calls.
|
|
20971
|
+
* Key format: "walkerName:exchangeName:frameName"
|
|
20972
|
+
* @param context - Context with walkerName, exchangeName, frameName
|
|
20973
|
+
* @returns Unique string key for memoization
|
|
20974
|
+
*/
|
|
20975
|
+
const CREATE_KEY_FN$r = (context) => {
|
|
20976
|
+
const parts = [context.walkerName, context.exchangeName];
|
|
20977
|
+
if (context.frameName)
|
|
20978
|
+
parts.push(context.frameName);
|
|
20979
|
+
return parts.join(":");
|
|
20980
|
+
};
|
|
20921
20981
|
/**
|
|
20922
20982
|
* Global service providing access to walker functionality.
|
|
20923
20983
|
*
|
|
@@ -20936,6 +20996,34 @@ class WalkerCommandService {
|
|
|
20936
20996
|
this.strategySchemaService = inject(TYPES.strategySchemaService);
|
|
20937
20997
|
this.riskValidationService = inject(TYPES.riskValidationService);
|
|
20938
20998
|
this.actionValidationService = inject(TYPES.actionValidationService);
|
|
20999
|
+
/**
|
|
21000
|
+
* Validates walker and associated strategy configurations.
|
|
21001
|
+
* Memoized to avoid redundant validations for the same walker-exchange-frame combination.
|
|
21002
|
+
*
|
|
21003
|
+
* Strategy/risk/action validation is performed explicitly here in addition to the
|
|
21004
|
+
* cascade inside WalkerValidationService — this is critical-path code and the
|
|
21005
|
+
* redundant check is intentional defense-in-depth.
|
|
21006
|
+
*
|
|
21007
|
+
* @param context - Context with walkerName, exchangeName and frameName
|
|
21008
|
+
* @param methodName - Name of the calling method for error tracking
|
|
21009
|
+
*/
|
|
21010
|
+
this.validate = memoize(([context]) => CREATE_KEY_FN$r(context), (context, methodName) => {
|
|
21011
|
+
this.loggerService.log(METHOD_NAME_VALIDATE$1, {
|
|
21012
|
+
context,
|
|
21013
|
+
methodName,
|
|
21014
|
+
});
|
|
21015
|
+
this.exchangeValidationService.validate(context.exchangeName, methodName);
|
|
21016
|
+
this.frameValidationService.validate(context.frameName, methodName);
|
|
21017
|
+
this.walkerValidationService.validate(context.walkerName, methodName);
|
|
21018
|
+
const walkerSchema = this.walkerSchemaService.get(context.walkerName);
|
|
21019
|
+
for (const strategyName of walkerSchema.strategies) {
|
|
21020
|
+
const { riskName, riskList, actions } = this.strategySchemaService.get(strategyName);
|
|
21021
|
+
this.strategyValidationService.validate(strategyName, methodName);
|
|
21022
|
+
riskName && this.riskValidationService.validate(riskName, methodName);
|
|
21023
|
+
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, methodName));
|
|
21024
|
+
actions && actions.forEach((actionName) => this.actionValidationService.validate(actionName, methodName));
|
|
21025
|
+
}
|
|
21026
|
+
});
|
|
20939
21027
|
/**
|
|
20940
21028
|
* Runs walker comparison for a symbol with context propagation.
|
|
20941
21029
|
*
|
|
@@ -20947,21 +21035,7 @@ class WalkerCommandService {
|
|
|
20947
21035
|
symbol,
|
|
20948
21036
|
context,
|
|
20949
21037
|
});
|
|
20950
|
-
|
|
20951
|
-
this.exchangeValidationService.validate(context.exchangeName, METHOD_NAME_RUN);
|
|
20952
|
-
this.frameValidationService.validate(context.frameName, METHOD_NAME_RUN);
|
|
20953
|
-
this.walkerValidationService.validate(context.walkerName, METHOD_NAME_RUN);
|
|
20954
|
-
}
|
|
20955
|
-
{
|
|
20956
|
-
const walkerSchema = this.walkerSchemaService.get(context.walkerName);
|
|
20957
|
-
for (const strategyName of walkerSchema.strategies) {
|
|
20958
|
-
const { riskName, riskList, actions } = this.strategySchemaService.get(strategyName);
|
|
20959
|
-
this.strategyValidationService.validate(strategyName, METHOD_NAME_RUN);
|
|
20960
|
-
riskName && this.riskValidationService.validate(riskName, METHOD_NAME_RUN);
|
|
20961
|
-
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, METHOD_NAME_RUN));
|
|
20962
|
-
actions && actions.forEach((actionName) => this.actionValidationService.validate(actionName, METHOD_NAME_RUN));
|
|
20963
|
-
}
|
|
20964
|
-
}
|
|
21038
|
+
this.validate(context, METHOD_NAME_RUN);
|
|
20965
21039
|
return this.walkerLogicPublicService.run(symbol, context);
|
|
20966
21040
|
};
|
|
20967
21041
|
}
|
|
@@ -28684,6 +28758,36 @@ class WalkerValidationService {
|
|
|
28684
28758
|
* Injected logger service instance
|
|
28685
28759
|
*/
|
|
28686
28760
|
this.loggerService = inject(TYPES.loggerService);
|
|
28761
|
+
/**
|
|
28762
|
+
* @private
|
|
28763
|
+
* @readonly
|
|
28764
|
+
* Injected walker schema service instance
|
|
28765
|
+
*/
|
|
28766
|
+
this.walkerSchemaService = inject(TYPES.walkerSchemaService);
|
|
28767
|
+
/**
|
|
28768
|
+
* @private
|
|
28769
|
+
* @readonly
|
|
28770
|
+
* Injected strategy validation service instance
|
|
28771
|
+
*/
|
|
28772
|
+
this.strategyValidationService = inject(TYPES.strategyValidationService);
|
|
28773
|
+
/**
|
|
28774
|
+
* @private
|
|
28775
|
+
* @readonly
|
|
28776
|
+
* Injected strategy schema service instance
|
|
28777
|
+
*/
|
|
28778
|
+
this.strategySchemaService = inject(TYPES.strategySchemaService);
|
|
28779
|
+
/**
|
|
28780
|
+
* @private
|
|
28781
|
+
* @readonly
|
|
28782
|
+
* Injected risk validation service instance
|
|
28783
|
+
*/
|
|
28784
|
+
this.riskValidationService = inject(TYPES.riskValidationService);
|
|
28785
|
+
/**
|
|
28786
|
+
* @private
|
|
28787
|
+
* @readonly
|
|
28788
|
+
* Injected action validation service instance
|
|
28789
|
+
*/
|
|
28790
|
+
this.actionValidationService = inject(TYPES.actionValidationService);
|
|
28687
28791
|
/**
|
|
28688
28792
|
* @private
|
|
28689
28793
|
* Map storing walker schemas by walker name
|
|
@@ -28705,9 +28809,12 @@ class WalkerValidationService {
|
|
|
28705
28809
|
this._walkerMap.set(walkerName, walkerSchema);
|
|
28706
28810
|
};
|
|
28707
28811
|
/**
|
|
28708
|
-
* Validates the existence of a walker
|
|
28812
|
+
* Validates the existence of a walker and its associated strategy configurations.
|
|
28813
|
+
* Each strategy referenced by the walker is validated via StrategyValidationService,
|
|
28814
|
+
* which in turn validates the strategy's risk profiles and actions.
|
|
28709
28815
|
* @public
|
|
28710
28816
|
* @throws {Error} If walkerName is not found
|
|
28817
|
+
* @throws {Error} If any referenced strategy (or its risk/actions) is invalid
|
|
28711
28818
|
* Memoized function to cache validation results
|
|
28712
28819
|
*/
|
|
28713
28820
|
this.validate = memoize(([walkerName]) => walkerName, (walkerName, source) => {
|
|
@@ -28719,6 +28826,14 @@ class WalkerValidationService {
|
|
|
28719
28826
|
if (!walker) {
|
|
28720
28827
|
throw new Error(`walker ${walkerName} not found source=${source}`);
|
|
28721
28828
|
}
|
|
28829
|
+
const walkerSchema = this.walkerSchemaService.get(walkerName);
|
|
28830
|
+
for (const strategyName of walkerSchema.strategies) {
|
|
28831
|
+
const { riskName, riskList, actions } = this.strategySchemaService.get(strategyName);
|
|
28832
|
+
this.strategyValidationService.validate(strategyName, source);
|
|
28833
|
+
riskName && this.riskValidationService.validate(riskName, source);
|
|
28834
|
+
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, source));
|
|
28835
|
+
actions && actions.forEach((actionName) => this.actionValidationService.validate(actionName, source));
|
|
28836
|
+
}
|
|
28722
28837
|
return true;
|
|
28723
28838
|
});
|
|
28724
28839
|
/**
|
|
@@ -30155,6 +30270,10 @@ class PartialGlobalService {
|
|
|
30155
30270
|
* Frame validation service for validating frame existence.
|
|
30156
30271
|
*/
|
|
30157
30272
|
this.frameValidationService = inject(TYPES.frameValidationService);
|
|
30273
|
+
/**
|
|
30274
|
+
* Action validation service for validating action existence.
|
|
30275
|
+
*/
|
|
30276
|
+
this.actionValidationService = inject(TYPES.actionValidationService);
|
|
30158
30277
|
/**
|
|
30159
30278
|
* Validates strategy and associated risk configuration.
|
|
30160
30279
|
* Memoized to avoid redundant validations for the same strategy-exchange-frame combination.
|
|
@@ -30170,9 +30289,10 @@ class PartialGlobalService {
|
|
|
30170
30289
|
this.strategyValidationService.validate(context.strategyName, methodName);
|
|
30171
30290
|
this.exchangeValidationService.validate(context.exchangeName, methodName);
|
|
30172
30291
|
context.frameName && this.frameValidationService.validate(context.frameName, methodName);
|
|
30173
|
-
const { riskName, riskList } = this.strategySchemaService.get(context.strategyName);
|
|
30292
|
+
const { riskName, riskList, actions } = this.strategySchemaService.get(context.strategyName);
|
|
30174
30293
|
riskName && this.riskValidationService.validate(riskName, methodName);
|
|
30175
30294
|
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, methodName));
|
|
30295
|
+
actions && actions.forEach((actionName) => this.actionValidationService.validate(actionName, methodName));
|
|
30176
30296
|
});
|
|
30177
30297
|
/**
|
|
30178
30298
|
* Processes profit state and emits events for newly reached profit levels.
|
|
@@ -31239,6 +31359,10 @@ class BreakevenGlobalService {
|
|
|
31239
31359
|
* Frame validation service for validating frame existence.
|
|
31240
31360
|
*/
|
|
31241
31361
|
this.frameValidationService = inject(TYPES.frameValidationService);
|
|
31362
|
+
/**
|
|
31363
|
+
* Action validation service for validating frame existence.
|
|
31364
|
+
*/
|
|
31365
|
+
this.actionValidationService = inject(TYPES.actionValidationService);
|
|
31242
31366
|
/**
|
|
31243
31367
|
* Validates strategy and associated risk configuration.
|
|
31244
31368
|
* Memoized to avoid redundant validations for the same strategy-exchange-frame combination.
|
|
@@ -31254,9 +31378,10 @@ class BreakevenGlobalService {
|
|
|
31254
31378
|
this.strategyValidationService.validate(context.strategyName, methodName);
|
|
31255
31379
|
this.exchangeValidationService.validate(context.exchangeName, methodName);
|
|
31256
31380
|
context.frameName && this.frameValidationService.validate(context.frameName, methodName);
|
|
31257
|
-
const { riskName, riskList } = this.strategySchemaService.get(context.strategyName);
|
|
31381
|
+
const { riskName, riskList, actions } = this.strategySchemaService.get(context.strategyName);
|
|
31258
31382
|
riskName && this.riskValidationService.validate(riskName, methodName);
|
|
31259
31383
|
riskList && riskList.forEach((riskName) => this.riskValidationService.validate(riskName, methodName));
|
|
31384
|
+
actions && actions.forEach((actionName) => this.actionValidationService.validate(actionName, methodName));
|
|
31260
31385
|
});
|
|
31261
31386
|
/**
|
|
31262
31387
|
* Checks if breakeven should be triggered and emits event if conditions met.
|
|
@@ -50598,6 +50723,7 @@ const GET_TIMESTAMP_METHOD_NAME = "meta.getTimestamp";
|
|
|
50598
50723
|
const GET_MODE_METHOD_NAME = "meta.getMode";
|
|
50599
50724
|
const GET_SYMBOL_METHOD_NAME = "meta.getSymbol";
|
|
50600
50725
|
const GET_CONTEXT_METHOD_NAME = "meta.getContext";
|
|
50726
|
+
const GET_RUNTIME_INFO_METHOD_NAME = "meta.getRuntimeInfo";
|
|
50601
50727
|
/**
|
|
50602
50728
|
* Gets the current date from execution context.
|
|
50603
50729
|
*
|
|
@@ -50714,6 +50840,45 @@ async function getContext() {
|
|
|
50714
50840
|
}
|
|
50715
50841
|
return backtest.methodContextService.context;
|
|
50716
50842
|
}
|
|
50843
|
+
/**
|
|
50844
|
+
* Gets runtime information about the current execution environment.
|
|
50845
|
+
*
|
|
50846
|
+
* This includes details such as the current symbol, exchange, timeframe, strategy, and whether it's a backtest or live run.
|
|
50847
|
+
*
|
|
50848
|
+
* @returns Promise resolving to an object containing runtime information
|
|
50849
|
+
* @throws Error if method context or execution context is not active
|
|
50850
|
+
*
|
|
50851
|
+
* @example
|
|
50852
|
+
* ```typescript
|
|
50853
|
+
* const runtimeInfo = await getRuntimeInfo();
|
|
50854
|
+
* console.log(runtimeInfo);
|
|
50855
|
+
* // {
|
|
50856
|
+
* // symbol: "BTCUSDT",
|
|
50857
|
+
* // context: {,
|
|
50858
|
+
* // exchangeName: "Binance",
|
|
50859
|
+
* // frameName: "1m",
|
|
50860
|
+
* // strategyName: "MyStrategy",
|
|
50861
|
+
* // },
|
|
50862
|
+
* // backtest: false
|
|
50863
|
+
* // }
|
|
50864
|
+
* ```
|
|
50865
|
+
*/
|
|
50866
|
+
async function getRuntimeInfo() {
|
|
50867
|
+
backtest.loggerService.info(GET_RUNTIME_INFO_METHOD_NAME);
|
|
50868
|
+
if (!MethodContextService.hasContext()) {
|
|
50869
|
+
throw new Error("getRuntimeInfo requires a method context");
|
|
50870
|
+
}
|
|
50871
|
+
if (!ExecutionContextService.hasContext()) {
|
|
50872
|
+
throw new Error("getRuntimeInfo requires an execution context");
|
|
50873
|
+
}
|
|
50874
|
+
const { exchangeName, frameName, strategyName } = backtest.methodContextService.context;
|
|
50875
|
+
const { symbol, backtest: isBacktest } = backtest.executionContextService.context;
|
|
50876
|
+
return await backtest.runtimeMetaService.getRuntimeInfo(symbol, {
|
|
50877
|
+
exchangeName,
|
|
50878
|
+
frameName,
|
|
50879
|
+
strategyName,
|
|
50880
|
+
}, isBacktest);
|
|
50881
|
+
}
|
|
50717
50882
|
|
|
50718
50883
|
const RECENT_PERSIST_BACKTEST_METHOD_NAME_HANDLE_ACTIVE_PING = "RecentPersistBacktestUtils.handleActivePing";
|
|
50719
50884
|
const RECENT_PERSIST_BACKTEST_METHOD_NAME_GET_LATEST_SIGNAL = "RecentPersistBacktestUtils.getLatestSignal";
|
|
@@ -66610,4 +66775,4 @@ const validateSignal = (signal, currentPrice) => {
|
|
|
66610
66775
|
return !errors.length;
|
|
66611
66776
|
};
|
|
66612
66777
|
|
|
66613
|
-
export { ActionBase, Backtest, Breakeven, Broker, BrokerBase, Cache, Constant, Cron, Dump, Exchange, ExecutionContextService, Heat, HighestProfit, Interval, Live, Log, Lookup, Markdown, MarkdownFileBase, MarkdownFolderBase, MarkdownWriter, MaxDrawdown, Memory, MemoryBacktest, MemoryBacktestAdapter, MemoryLive, MemoryLiveAdapter, MethodContextService, Notification, NotificationBacktest, NotificationLive, Partial, Performance, PersistBase, PersistBreakevenAdapter, PersistBreakevenInstance, PersistCandleAdapter, PersistCandleInstance, PersistIntervalAdapter, PersistIntervalInstance, PersistLogAdapter, PersistLogInstance, PersistMeasureAdapter, PersistMeasureInstance, PersistMemoryAdapter, PersistMemoryInstance, PersistNotificationAdapter, PersistNotificationInstance, PersistPartialAdapter, PersistPartialInstance, PersistRecentAdapter, PersistRecentInstance, PersistRiskAdapter, PersistRiskInstance, PersistScheduleAdapter, PersistScheduleInstance, PersistSessionAdapter, PersistSessionInstance, PersistSignalAdapter, PersistSignalInstance, PersistStateAdapter, PersistStateInstance, PersistStorageAdapter, PersistStorageInstance, Position, PositionSize, Recent, RecentBacktest, RecentLive, Reflect$1 as Reflect, Report, ReportBase, ReportWriter, Risk, Schedule, Session, SessionBacktest, SessionLive, State, StateBacktest, StateBacktestAdapter, StateLive, StateLiveAdapter, Storage, StorageBacktest, StorageLive, Strategy, Sync, System, Walker, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, beginContext, beginTime, cacheCandles, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialLossCost, commitPartialProfit, commitPartialProfitCost, commitSignalNotify, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, createSignalState, dumpAgentAnswer, dumpError, dumpJson, dumpRecord, dumpTable, dumpText, emitters, formatPrice, formatQuantity, get, getActionSchema, getAggregatedTrades, getAveragePrice, getBacktestTimeframe, getBreakeven, getCandles, getClosePrice, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getEffectivePriceOpen, getExchangeSchema, getFrameSchema, getLatestSignal, getMaxDrawdownDistancePnlCost, getMaxDrawdownDistancePnlPercentage, getMinutesSinceLatestSignalCreated, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionActiveMinutes, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestMaxDrawdownPnlCost, getPositionHighestMaxDrawdownPnlPercentage, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitDistancePnlCost, getPositionHighestProfitDistancePnlPercentage, getPositionHighestProfitMinutes, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionMaxDrawdownMinutes, getPositionMaxDrawdownPnlCost, getPositionMaxDrawdownPnlPercentage, getPositionMaxDrawdownPrice, getPositionMaxDrawdownTimestamp, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getPositionWaitingMinutes, getRawCandles, getRiskSchema, getScheduledSignal, getSessionData, getSignalState, getSizingSchema, getStrategySchema, getSymbol, getTimestamp, getTotalClosed, getTotalCostClosed, getTotalPercentClosed, getWalkerSchema, hasNoPendingSignal, hasNoScheduledSignal, hasTradeContext, intervalStepMs, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, listMemory, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenAfterEnd, listenAfterEndOnce, listenBacktestProgress, listenBeforeStart, listenBeforeStartOnce, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenHighestProfit, listenHighestProfitOnce, listenIdlePing, listenIdlePingOnce, listenMaxDrawdown, listenMaxDrawdownOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalNotify, listenSignalNotifyOnce, listenSignalOnce, listenStrategyCommit, listenStrategyCommitOnce, listenSync, listenSyncOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, percentDiff, percentToCloseCost, percentValue, readMemory, removeMemory, roundTicks, runInMockContext, searchMemory, set, setColumns, setConfig, setLogger, setSessionData, setSignalState, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toPlainString, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, waitForReady, warmCandles, writeMemory };
|
|
66778
|
+
export { ActionBase, Backtest, Breakeven, Broker, BrokerBase, Cache, Constant, Cron, Dump, Exchange, ExecutionContextService, Heat, HighestProfit, Interval, Live, Log, Lookup, Markdown, MarkdownFileBase, MarkdownFolderBase, MarkdownWriter, MaxDrawdown, Memory, MemoryBacktest, MemoryBacktestAdapter, MemoryLive, MemoryLiveAdapter, MethodContextService, Notification, NotificationBacktest, NotificationLive, Partial, Performance, PersistBase, PersistBreakevenAdapter, PersistBreakevenInstance, PersistCandleAdapter, PersistCandleInstance, PersistIntervalAdapter, PersistIntervalInstance, PersistLogAdapter, PersistLogInstance, PersistMeasureAdapter, PersistMeasureInstance, PersistMemoryAdapter, PersistMemoryInstance, PersistNotificationAdapter, PersistNotificationInstance, PersistPartialAdapter, PersistPartialInstance, PersistRecentAdapter, PersistRecentInstance, PersistRiskAdapter, PersistRiskInstance, PersistScheduleAdapter, PersistScheduleInstance, PersistSessionAdapter, PersistSessionInstance, PersistSignalAdapter, PersistSignalInstance, PersistStateAdapter, PersistStateInstance, PersistStorageAdapter, PersistStorageInstance, Position, PositionSize, Recent, RecentBacktest, RecentLive, Reflect$1 as Reflect, Report, ReportBase, ReportWriter, Risk, Schedule, Session, SessionBacktest, SessionLive, State, StateBacktest, StateBacktestAdapter, StateLive, StateLiveAdapter, Storage, StorageBacktest, StorageLive, Strategy, Sync, System, Walker, addActionSchema, addExchangeSchema, addFrameSchema, addRiskSchema, addSizingSchema, addStrategySchema, addWalkerSchema, alignToInterval, beginContext, beginTime, cacheCandles, checkCandles, commitActivateScheduled, commitAverageBuy, commitBreakeven, commitCancelScheduled, commitClosePending, commitPartialLoss, commitPartialLossCost, commitPartialProfit, commitPartialProfitCost, commitSignalNotify, commitTrailingStop, commitTrailingStopCost, commitTrailingTake, commitTrailingTakeCost, createSignalState, dumpAgentAnswer, dumpError, dumpJson, dumpRecord, dumpTable, dumpText, emitters, formatPrice, formatQuantity, get, getActionSchema, getAggregatedTrades, getAveragePrice, getBacktestTimeframe, getBreakeven, getCandles, getClosePrice, getColumns, getConfig, getContext, getDate, getDefaultColumns, getDefaultConfig, getEffectivePriceOpen, getExchangeSchema, getFrameSchema, getLatestSignal, getMaxDrawdownDistancePnlCost, getMaxDrawdownDistancePnlPercentage, getMinutesSinceLatestSignalCreated, getMode, getNextCandles, getOrderBook, getPendingSignal, getPositionActiveMinutes, getPositionCountdownMinutes, getPositionDrawdownMinutes, getPositionEffectivePrice, getPositionEntries, getPositionEntryOverlap, getPositionEstimateMinutes, getPositionHighestMaxDrawdownPnlCost, getPositionHighestMaxDrawdownPnlPercentage, getPositionHighestPnlCost, getPositionHighestPnlPercentage, getPositionHighestProfitBreakeven, getPositionHighestProfitDistancePnlCost, getPositionHighestProfitDistancePnlPercentage, getPositionHighestProfitMinutes, getPositionHighestProfitPrice, getPositionHighestProfitTimestamp, getPositionInvestedCost, getPositionInvestedCount, getPositionLevels, getPositionMaxDrawdownMinutes, getPositionMaxDrawdownPnlCost, getPositionMaxDrawdownPnlPercentage, getPositionMaxDrawdownPrice, getPositionMaxDrawdownTimestamp, getPositionPartialOverlap, getPositionPartials, getPositionPnlCost, getPositionPnlPercent, getPositionWaitingMinutes, getRawCandles, getRiskSchema, getRuntimeInfo, getScheduledSignal, getSessionData, getSignalState, getSizingSchema, getStrategySchema, getSymbol, getTimestamp, getTotalClosed, getTotalCostClosed, getTotalPercentClosed, getWalkerSchema, hasNoPendingSignal, hasNoScheduledSignal, hasTradeContext, intervalStepMs, investedCostToPercent, backtest as lib, listExchangeSchema, listFrameSchema, listMemory, listRiskSchema, listSizingSchema, listStrategySchema, listWalkerSchema, listenActivePing, listenActivePingOnce, listenAfterEnd, listenAfterEndOnce, listenBacktestProgress, listenBeforeStart, listenBeforeStartOnce, listenBreakevenAvailable, listenBreakevenAvailableOnce, listenDoneBacktest, listenDoneBacktestOnce, listenDoneLive, listenDoneLiveOnce, listenDoneWalker, listenDoneWalkerOnce, listenError, listenExit, listenHighestProfit, listenHighestProfitOnce, listenIdlePing, listenIdlePingOnce, listenMaxDrawdown, listenMaxDrawdownOnce, listenPartialLossAvailable, listenPartialLossAvailableOnce, listenPartialProfitAvailable, listenPartialProfitAvailableOnce, listenPerformance, listenRisk, listenRiskOnce, listenSchedulePing, listenSchedulePingOnce, listenSignal, listenSignalBacktest, listenSignalBacktestOnce, listenSignalLive, listenSignalLiveOnce, listenSignalNotify, listenSignalNotifyOnce, listenSignalOnce, listenStrategyCommit, listenStrategyCommitOnce, listenSync, listenSyncOnce, listenValidation, listenWalker, listenWalkerComplete, listenWalkerOnce, listenWalkerProgress, overrideActionSchema, overrideExchangeSchema, overrideFrameSchema, overrideRiskSchema, overrideSizingSchema, overrideStrategySchema, overrideWalkerSchema, parseArgs, percentDiff, percentToCloseCost, percentValue, readMemory, removeMemory, roundTicks, runInMockContext, searchMemory, set, setColumns, setConfig, setLogger, setSessionData, setSignalState, shutdown, slPercentShiftToPrice, slPriceToPercentShift, stopStrategy, toPlainString, toProfitLossDto, tpPercentShiftToPrice, tpPriceToPercentShift, validate, validateCommonSignal, validatePendingSignal, validateScheduledSignal, validateSignal, waitForCandle, waitForReady, warmCandles, writeMemory };
|