backtest-kit 1.5.8 → 1.5.9
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 +69 -3
- package/build/index.mjs +69 -3
- package/package.json +1 -1
package/build/index.cjs
CHANGED
|
@@ -13738,10 +13738,12 @@ class BacktestUtils {
|
|
|
13738
13738
|
* ```
|
|
13739
13739
|
*/
|
|
13740
13740
|
this.background = (symbol, context) => {
|
|
13741
|
+
backtest$1.strategyValidationService.validate(context.strategyName, BACKTEST_METHOD_NAME_BACKGROUND);
|
|
13742
|
+
backtest$1.exchangeValidationService.validate(context.exchangeName, BACKTEST_METHOD_NAME_BACKGROUND);
|
|
13743
|
+
backtest$1.frameValidationService.validate(context.frameName, BACKTEST_METHOD_NAME_BACKGROUND);
|
|
13741
13744
|
{
|
|
13742
|
-
backtest$1.
|
|
13743
|
-
backtest$1.
|
|
13744
|
-
backtest$1.frameValidationService.validate(context.frameName, BACKTEST_METHOD_NAME_BACKGROUND);
|
|
13745
|
+
const { riskName } = backtest$1.strategySchemaService.get(context.strategyName);
|
|
13746
|
+
riskName && backtest$1.riskValidationService.validate(riskName, BACKTEST_METHOD_NAME_BACKGROUND);
|
|
13745
13747
|
}
|
|
13746
13748
|
const instance = this._getInstance(symbol, context.strategyName);
|
|
13747
13749
|
return instance.background(symbol, context);
|
|
@@ -13765,6 +13767,10 @@ class BacktestUtils {
|
|
|
13765
13767
|
*/
|
|
13766
13768
|
this.stop = async (symbol, strategyName) => {
|
|
13767
13769
|
backtest$1.strategyValidationService.validate(strategyName, BACKTEST_METHOD_NAME_STOP);
|
|
13770
|
+
{
|
|
13771
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
13772
|
+
riskName && backtest$1.riskValidationService.validate(riskName, BACKTEST_METHOD_NAME_STOP);
|
|
13773
|
+
}
|
|
13768
13774
|
const instance = this._getInstance(symbol, strategyName);
|
|
13769
13775
|
return await instance.stop(symbol, strategyName);
|
|
13770
13776
|
};
|
|
@@ -13783,6 +13789,10 @@ class BacktestUtils {
|
|
|
13783
13789
|
*/
|
|
13784
13790
|
this.getData = async (symbol, strategyName) => {
|
|
13785
13791
|
backtest$1.strategyValidationService.validate(strategyName, "BacktestUtils.getData");
|
|
13792
|
+
{
|
|
13793
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
13794
|
+
riskName && backtest$1.riskValidationService.validate(riskName, "BacktestUtils.getData");
|
|
13795
|
+
}
|
|
13786
13796
|
const instance = this._getInstance(symbol, strategyName);
|
|
13787
13797
|
return await instance.getData(symbol, strategyName);
|
|
13788
13798
|
};
|
|
@@ -13801,6 +13811,10 @@ class BacktestUtils {
|
|
|
13801
13811
|
*/
|
|
13802
13812
|
this.getReport = async (symbol, strategyName) => {
|
|
13803
13813
|
backtest$1.strategyValidationService.validate(strategyName, BACKTEST_METHOD_NAME_GET_REPORT);
|
|
13814
|
+
{
|
|
13815
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
13816
|
+
riskName && backtest$1.riskValidationService.validate(riskName, BACKTEST_METHOD_NAME_GET_REPORT);
|
|
13817
|
+
}
|
|
13804
13818
|
const instance = this._getInstance(symbol, strategyName);
|
|
13805
13819
|
return await instance.getReport(symbol, strategyName);
|
|
13806
13820
|
};
|
|
@@ -13822,6 +13836,10 @@ class BacktestUtils {
|
|
|
13822
13836
|
*/
|
|
13823
13837
|
this.dump = async (symbol, strategyName, path) => {
|
|
13824
13838
|
backtest$1.strategyValidationService.validate(strategyName, BACKTEST_METHOD_NAME_DUMP);
|
|
13839
|
+
{
|
|
13840
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
13841
|
+
riskName && backtest$1.riskValidationService.validate(riskName, BACKTEST_METHOD_NAME_DUMP);
|
|
13842
|
+
}
|
|
13825
13843
|
const instance = this._getInstance(symbol, strategyName);
|
|
13826
13844
|
return await instance.dump(symbol, strategyName, path);
|
|
13827
13845
|
};
|
|
@@ -14223,6 +14241,10 @@ class LiveUtils {
|
|
|
14223
14241
|
this.background = (symbol, context) => {
|
|
14224
14242
|
backtest$1.strategyValidationService.validate(context.strategyName, LIVE_METHOD_NAME_BACKGROUND);
|
|
14225
14243
|
backtest$1.exchangeValidationService.validate(context.exchangeName, LIVE_METHOD_NAME_BACKGROUND);
|
|
14244
|
+
{
|
|
14245
|
+
const { riskName } = backtest$1.strategySchemaService.get(context.strategyName);
|
|
14246
|
+
riskName && backtest$1.riskValidationService.validate(riskName, LIVE_METHOD_NAME_BACKGROUND);
|
|
14247
|
+
}
|
|
14226
14248
|
const instance = this._getInstance(symbol, context.strategyName);
|
|
14227
14249
|
return instance.background(symbol, context);
|
|
14228
14250
|
};
|
|
@@ -14245,6 +14267,10 @@ class LiveUtils {
|
|
|
14245
14267
|
*/
|
|
14246
14268
|
this.stop = async (symbol, strategyName) => {
|
|
14247
14269
|
backtest$1.strategyValidationService.validate(strategyName, LIVE_METHOD_NAME_STOP);
|
|
14270
|
+
{
|
|
14271
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
14272
|
+
riskName && backtest$1.riskValidationService.validate(riskName, LIVE_METHOD_NAME_STOP);
|
|
14273
|
+
}
|
|
14248
14274
|
const instance = this._getInstance(symbol, strategyName);
|
|
14249
14275
|
return await instance.stop(symbol, strategyName);
|
|
14250
14276
|
};
|
|
@@ -14263,6 +14289,10 @@ class LiveUtils {
|
|
|
14263
14289
|
*/
|
|
14264
14290
|
this.getData = async (symbol, strategyName) => {
|
|
14265
14291
|
backtest$1.strategyValidationService.validate(strategyName, "LiveUtils.getData");
|
|
14292
|
+
{
|
|
14293
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
14294
|
+
riskName && backtest$1.riskValidationService.validate(riskName, "LiveUtils.getData");
|
|
14295
|
+
}
|
|
14266
14296
|
const instance = this._getInstance(symbol, strategyName);
|
|
14267
14297
|
return await instance.getData(symbol, strategyName);
|
|
14268
14298
|
};
|
|
@@ -14281,6 +14311,10 @@ class LiveUtils {
|
|
|
14281
14311
|
*/
|
|
14282
14312
|
this.getReport = async (symbol, strategyName) => {
|
|
14283
14313
|
backtest$1.strategyValidationService.validate(strategyName, LIVE_METHOD_NAME_GET_REPORT);
|
|
14314
|
+
{
|
|
14315
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
14316
|
+
riskName && backtest$1.riskValidationService.validate(riskName, LIVE_METHOD_NAME_GET_REPORT);
|
|
14317
|
+
}
|
|
14284
14318
|
const instance = this._getInstance(symbol, strategyName);
|
|
14285
14319
|
return await instance.getReport(symbol, strategyName);
|
|
14286
14320
|
};
|
|
@@ -14302,6 +14336,10 @@ class LiveUtils {
|
|
|
14302
14336
|
*/
|
|
14303
14337
|
this.dump = async (symbol, strategyName, path) => {
|
|
14304
14338
|
backtest$1.strategyValidationService.validate(strategyName, LIVE_METHOD_NAME_DUMP);
|
|
14339
|
+
{
|
|
14340
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
14341
|
+
riskName && backtest$1.riskValidationService.validate(riskName, LIVE_METHOD_NAME_DUMP);
|
|
14342
|
+
}
|
|
14305
14343
|
const instance = this._getInstance(symbol, strategyName);
|
|
14306
14344
|
return await instance.dump(symbol, strategyName, path);
|
|
14307
14345
|
};
|
|
@@ -14973,6 +15011,13 @@ class WalkerUtils {
|
|
|
14973
15011
|
*/
|
|
14974
15012
|
this.stop = async (symbol, walkerName) => {
|
|
14975
15013
|
backtest$1.walkerValidationService.validate(walkerName, WALKER_METHOD_NAME_STOP);
|
|
15014
|
+
const walkerSchema = backtest$1.walkerSchemaService.get(walkerName);
|
|
15015
|
+
for (const strategyName of walkerSchema.strategies) {
|
|
15016
|
+
backtest$1.strategyValidationService.validate(strategyName, WALKER_METHOD_NAME_STOP);
|
|
15017
|
+
const strategySchema = backtest$1.strategySchemaService.get(strategyName);
|
|
15018
|
+
const riskName = strategySchema.riskName;
|
|
15019
|
+
riskName && backtest$1.riskValidationService.validate(riskName, WALKER_METHOD_NAME_STOP);
|
|
15020
|
+
}
|
|
14976
15021
|
const instance = this._getInstance(symbol, walkerName);
|
|
14977
15022
|
return await instance.stop(symbol, walkerName);
|
|
14978
15023
|
};
|
|
@@ -14991,6 +15036,13 @@ class WalkerUtils {
|
|
|
14991
15036
|
*/
|
|
14992
15037
|
this.getData = async (symbol, walkerName) => {
|
|
14993
15038
|
backtest$1.walkerValidationService.validate(walkerName, WALKER_METHOD_NAME_GET_DATA);
|
|
15039
|
+
const walkerSchema = backtest$1.walkerSchemaService.get(walkerName);
|
|
15040
|
+
for (const strategyName of walkerSchema.strategies) {
|
|
15041
|
+
backtest$1.strategyValidationService.validate(strategyName, WALKER_METHOD_NAME_GET_DATA);
|
|
15042
|
+
const strategySchema = backtest$1.strategySchemaService.get(strategyName);
|
|
15043
|
+
const riskName = strategySchema.riskName;
|
|
15044
|
+
riskName && backtest$1.riskValidationService.validate(riskName, WALKER_METHOD_NAME_GET_DATA);
|
|
15045
|
+
}
|
|
14994
15046
|
const instance = this._getInstance(symbol, walkerName);
|
|
14995
15047
|
return await instance.getData(symbol, walkerName);
|
|
14996
15048
|
};
|
|
@@ -15009,6 +15061,13 @@ class WalkerUtils {
|
|
|
15009
15061
|
*/
|
|
15010
15062
|
this.getReport = async (symbol, walkerName) => {
|
|
15011
15063
|
backtest$1.walkerValidationService.validate(walkerName, WALKER_METHOD_NAME_GET_REPORT);
|
|
15064
|
+
const walkerSchema = backtest$1.walkerSchemaService.get(walkerName);
|
|
15065
|
+
for (const strategyName of walkerSchema.strategies) {
|
|
15066
|
+
backtest$1.strategyValidationService.validate(strategyName, WALKER_METHOD_NAME_GET_REPORT);
|
|
15067
|
+
const strategySchema = backtest$1.strategySchemaService.get(strategyName);
|
|
15068
|
+
const riskName = strategySchema.riskName;
|
|
15069
|
+
riskName && backtest$1.riskValidationService.validate(riskName, WALKER_METHOD_NAME_GET_REPORT);
|
|
15070
|
+
}
|
|
15012
15071
|
const instance = this._getInstance(symbol, walkerName);
|
|
15013
15072
|
return await instance.getReport(symbol, walkerName);
|
|
15014
15073
|
};
|
|
@@ -15030,6 +15089,13 @@ class WalkerUtils {
|
|
|
15030
15089
|
*/
|
|
15031
15090
|
this.dump = async (symbol, walkerName, path) => {
|
|
15032
15091
|
backtest$1.walkerValidationService.validate(walkerName, WALKER_METHOD_NAME_DUMP);
|
|
15092
|
+
const walkerSchema = backtest$1.walkerSchemaService.get(walkerName);
|
|
15093
|
+
for (const strategyName of walkerSchema.strategies) {
|
|
15094
|
+
backtest$1.strategyValidationService.validate(strategyName, WALKER_METHOD_NAME_DUMP);
|
|
15095
|
+
const strategySchema = backtest$1.strategySchemaService.get(strategyName);
|
|
15096
|
+
const riskName = strategySchema.riskName;
|
|
15097
|
+
riskName && backtest$1.riskValidationService.validate(riskName, WALKER_METHOD_NAME_DUMP);
|
|
15098
|
+
}
|
|
15033
15099
|
const instance = this._getInstance(symbol, walkerName);
|
|
15034
15100
|
return await instance.dump(symbol, walkerName, path);
|
|
15035
15101
|
};
|
package/build/index.mjs
CHANGED
|
@@ -13736,10 +13736,12 @@ class BacktestUtils {
|
|
|
13736
13736
|
* ```
|
|
13737
13737
|
*/
|
|
13738
13738
|
this.background = (symbol, context) => {
|
|
13739
|
+
backtest$1.strategyValidationService.validate(context.strategyName, BACKTEST_METHOD_NAME_BACKGROUND);
|
|
13740
|
+
backtest$1.exchangeValidationService.validate(context.exchangeName, BACKTEST_METHOD_NAME_BACKGROUND);
|
|
13741
|
+
backtest$1.frameValidationService.validate(context.frameName, BACKTEST_METHOD_NAME_BACKGROUND);
|
|
13739
13742
|
{
|
|
13740
|
-
backtest$1.
|
|
13741
|
-
backtest$1.
|
|
13742
|
-
backtest$1.frameValidationService.validate(context.frameName, BACKTEST_METHOD_NAME_BACKGROUND);
|
|
13743
|
+
const { riskName } = backtest$1.strategySchemaService.get(context.strategyName);
|
|
13744
|
+
riskName && backtest$1.riskValidationService.validate(riskName, BACKTEST_METHOD_NAME_BACKGROUND);
|
|
13743
13745
|
}
|
|
13744
13746
|
const instance = this._getInstance(symbol, context.strategyName);
|
|
13745
13747
|
return instance.background(symbol, context);
|
|
@@ -13763,6 +13765,10 @@ class BacktestUtils {
|
|
|
13763
13765
|
*/
|
|
13764
13766
|
this.stop = async (symbol, strategyName) => {
|
|
13765
13767
|
backtest$1.strategyValidationService.validate(strategyName, BACKTEST_METHOD_NAME_STOP);
|
|
13768
|
+
{
|
|
13769
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
13770
|
+
riskName && backtest$1.riskValidationService.validate(riskName, BACKTEST_METHOD_NAME_STOP);
|
|
13771
|
+
}
|
|
13766
13772
|
const instance = this._getInstance(symbol, strategyName);
|
|
13767
13773
|
return await instance.stop(symbol, strategyName);
|
|
13768
13774
|
};
|
|
@@ -13781,6 +13787,10 @@ class BacktestUtils {
|
|
|
13781
13787
|
*/
|
|
13782
13788
|
this.getData = async (symbol, strategyName) => {
|
|
13783
13789
|
backtest$1.strategyValidationService.validate(strategyName, "BacktestUtils.getData");
|
|
13790
|
+
{
|
|
13791
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
13792
|
+
riskName && backtest$1.riskValidationService.validate(riskName, "BacktestUtils.getData");
|
|
13793
|
+
}
|
|
13784
13794
|
const instance = this._getInstance(symbol, strategyName);
|
|
13785
13795
|
return await instance.getData(symbol, strategyName);
|
|
13786
13796
|
};
|
|
@@ -13799,6 +13809,10 @@ class BacktestUtils {
|
|
|
13799
13809
|
*/
|
|
13800
13810
|
this.getReport = async (symbol, strategyName) => {
|
|
13801
13811
|
backtest$1.strategyValidationService.validate(strategyName, BACKTEST_METHOD_NAME_GET_REPORT);
|
|
13812
|
+
{
|
|
13813
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
13814
|
+
riskName && backtest$1.riskValidationService.validate(riskName, BACKTEST_METHOD_NAME_GET_REPORT);
|
|
13815
|
+
}
|
|
13802
13816
|
const instance = this._getInstance(symbol, strategyName);
|
|
13803
13817
|
return await instance.getReport(symbol, strategyName);
|
|
13804
13818
|
};
|
|
@@ -13820,6 +13834,10 @@ class BacktestUtils {
|
|
|
13820
13834
|
*/
|
|
13821
13835
|
this.dump = async (symbol, strategyName, path) => {
|
|
13822
13836
|
backtest$1.strategyValidationService.validate(strategyName, BACKTEST_METHOD_NAME_DUMP);
|
|
13837
|
+
{
|
|
13838
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
13839
|
+
riskName && backtest$1.riskValidationService.validate(riskName, BACKTEST_METHOD_NAME_DUMP);
|
|
13840
|
+
}
|
|
13823
13841
|
const instance = this._getInstance(symbol, strategyName);
|
|
13824
13842
|
return await instance.dump(symbol, strategyName, path);
|
|
13825
13843
|
};
|
|
@@ -14221,6 +14239,10 @@ class LiveUtils {
|
|
|
14221
14239
|
this.background = (symbol, context) => {
|
|
14222
14240
|
backtest$1.strategyValidationService.validate(context.strategyName, LIVE_METHOD_NAME_BACKGROUND);
|
|
14223
14241
|
backtest$1.exchangeValidationService.validate(context.exchangeName, LIVE_METHOD_NAME_BACKGROUND);
|
|
14242
|
+
{
|
|
14243
|
+
const { riskName } = backtest$1.strategySchemaService.get(context.strategyName);
|
|
14244
|
+
riskName && backtest$1.riskValidationService.validate(riskName, LIVE_METHOD_NAME_BACKGROUND);
|
|
14245
|
+
}
|
|
14224
14246
|
const instance = this._getInstance(symbol, context.strategyName);
|
|
14225
14247
|
return instance.background(symbol, context);
|
|
14226
14248
|
};
|
|
@@ -14243,6 +14265,10 @@ class LiveUtils {
|
|
|
14243
14265
|
*/
|
|
14244
14266
|
this.stop = async (symbol, strategyName) => {
|
|
14245
14267
|
backtest$1.strategyValidationService.validate(strategyName, LIVE_METHOD_NAME_STOP);
|
|
14268
|
+
{
|
|
14269
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
14270
|
+
riskName && backtest$1.riskValidationService.validate(riskName, LIVE_METHOD_NAME_STOP);
|
|
14271
|
+
}
|
|
14246
14272
|
const instance = this._getInstance(symbol, strategyName);
|
|
14247
14273
|
return await instance.stop(symbol, strategyName);
|
|
14248
14274
|
};
|
|
@@ -14261,6 +14287,10 @@ class LiveUtils {
|
|
|
14261
14287
|
*/
|
|
14262
14288
|
this.getData = async (symbol, strategyName) => {
|
|
14263
14289
|
backtest$1.strategyValidationService.validate(strategyName, "LiveUtils.getData");
|
|
14290
|
+
{
|
|
14291
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
14292
|
+
riskName && backtest$1.riskValidationService.validate(riskName, "LiveUtils.getData");
|
|
14293
|
+
}
|
|
14264
14294
|
const instance = this._getInstance(symbol, strategyName);
|
|
14265
14295
|
return await instance.getData(symbol, strategyName);
|
|
14266
14296
|
};
|
|
@@ -14279,6 +14309,10 @@ class LiveUtils {
|
|
|
14279
14309
|
*/
|
|
14280
14310
|
this.getReport = async (symbol, strategyName) => {
|
|
14281
14311
|
backtest$1.strategyValidationService.validate(strategyName, LIVE_METHOD_NAME_GET_REPORT);
|
|
14312
|
+
{
|
|
14313
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
14314
|
+
riskName && backtest$1.riskValidationService.validate(riskName, LIVE_METHOD_NAME_GET_REPORT);
|
|
14315
|
+
}
|
|
14282
14316
|
const instance = this._getInstance(symbol, strategyName);
|
|
14283
14317
|
return await instance.getReport(symbol, strategyName);
|
|
14284
14318
|
};
|
|
@@ -14300,6 +14334,10 @@ class LiveUtils {
|
|
|
14300
14334
|
*/
|
|
14301
14335
|
this.dump = async (symbol, strategyName, path) => {
|
|
14302
14336
|
backtest$1.strategyValidationService.validate(strategyName, LIVE_METHOD_NAME_DUMP);
|
|
14337
|
+
{
|
|
14338
|
+
const { riskName } = backtest$1.strategySchemaService.get(strategyName);
|
|
14339
|
+
riskName && backtest$1.riskValidationService.validate(riskName, LIVE_METHOD_NAME_DUMP);
|
|
14340
|
+
}
|
|
14303
14341
|
const instance = this._getInstance(symbol, strategyName);
|
|
14304
14342
|
return await instance.dump(symbol, strategyName, path);
|
|
14305
14343
|
};
|
|
@@ -14971,6 +15009,13 @@ class WalkerUtils {
|
|
|
14971
15009
|
*/
|
|
14972
15010
|
this.stop = async (symbol, walkerName) => {
|
|
14973
15011
|
backtest$1.walkerValidationService.validate(walkerName, WALKER_METHOD_NAME_STOP);
|
|
15012
|
+
const walkerSchema = backtest$1.walkerSchemaService.get(walkerName);
|
|
15013
|
+
for (const strategyName of walkerSchema.strategies) {
|
|
15014
|
+
backtest$1.strategyValidationService.validate(strategyName, WALKER_METHOD_NAME_STOP);
|
|
15015
|
+
const strategySchema = backtest$1.strategySchemaService.get(strategyName);
|
|
15016
|
+
const riskName = strategySchema.riskName;
|
|
15017
|
+
riskName && backtest$1.riskValidationService.validate(riskName, WALKER_METHOD_NAME_STOP);
|
|
15018
|
+
}
|
|
14974
15019
|
const instance = this._getInstance(symbol, walkerName);
|
|
14975
15020
|
return await instance.stop(symbol, walkerName);
|
|
14976
15021
|
};
|
|
@@ -14989,6 +15034,13 @@ class WalkerUtils {
|
|
|
14989
15034
|
*/
|
|
14990
15035
|
this.getData = async (symbol, walkerName) => {
|
|
14991
15036
|
backtest$1.walkerValidationService.validate(walkerName, WALKER_METHOD_NAME_GET_DATA);
|
|
15037
|
+
const walkerSchema = backtest$1.walkerSchemaService.get(walkerName);
|
|
15038
|
+
for (const strategyName of walkerSchema.strategies) {
|
|
15039
|
+
backtest$1.strategyValidationService.validate(strategyName, WALKER_METHOD_NAME_GET_DATA);
|
|
15040
|
+
const strategySchema = backtest$1.strategySchemaService.get(strategyName);
|
|
15041
|
+
const riskName = strategySchema.riskName;
|
|
15042
|
+
riskName && backtest$1.riskValidationService.validate(riskName, WALKER_METHOD_NAME_GET_DATA);
|
|
15043
|
+
}
|
|
14992
15044
|
const instance = this._getInstance(symbol, walkerName);
|
|
14993
15045
|
return await instance.getData(symbol, walkerName);
|
|
14994
15046
|
};
|
|
@@ -15007,6 +15059,13 @@ class WalkerUtils {
|
|
|
15007
15059
|
*/
|
|
15008
15060
|
this.getReport = async (symbol, walkerName) => {
|
|
15009
15061
|
backtest$1.walkerValidationService.validate(walkerName, WALKER_METHOD_NAME_GET_REPORT);
|
|
15062
|
+
const walkerSchema = backtest$1.walkerSchemaService.get(walkerName);
|
|
15063
|
+
for (const strategyName of walkerSchema.strategies) {
|
|
15064
|
+
backtest$1.strategyValidationService.validate(strategyName, WALKER_METHOD_NAME_GET_REPORT);
|
|
15065
|
+
const strategySchema = backtest$1.strategySchemaService.get(strategyName);
|
|
15066
|
+
const riskName = strategySchema.riskName;
|
|
15067
|
+
riskName && backtest$1.riskValidationService.validate(riskName, WALKER_METHOD_NAME_GET_REPORT);
|
|
15068
|
+
}
|
|
15010
15069
|
const instance = this._getInstance(symbol, walkerName);
|
|
15011
15070
|
return await instance.getReport(symbol, walkerName);
|
|
15012
15071
|
};
|
|
@@ -15028,6 +15087,13 @@ class WalkerUtils {
|
|
|
15028
15087
|
*/
|
|
15029
15088
|
this.dump = async (symbol, walkerName, path) => {
|
|
15030
15089
|
backtest$1.walkerValidationService.validate(walkerName, WALKER_METHOD_NAME_DUMP);
|
|
15090
|
+
const walkerSchema = backtest$1.walkerSchemaService.get(walkerName);
|
|
15091
|
+
for (const strategyName of walkerSchema.strategies) {
|
|
15092
|
+
backtest$1.strategyValidationService.validate(strategyName, WALKER_METHOD_NAME_DUMP);
|
|
15093
|
+
const strategySchema = backtest$1.strategySchemaService.get(strategyName);
|
|
15094
|
+
const riskName = strategySchema.riskName;
|
|
15095
|
+
riskName && backtest$1.riskValidationService.validate(riskName, WALKER_METHOD_NAME_DUMP);
|
|
15096
|
+
}
|
|
15031
15097
|
const instance = this._getInstance(symbol, walkerName);
|
|
15032
15098
|
return await instance.dump(symbol, walkerName, path);
|
|
15033
15099
|
};
|