backtest-kit 8.0.0 → 8.1.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 +1804 -1804
- package/build/index.cjs +42 -5
- package/build/index.mjs +42 -5
- package/package.json +86 -86
- package/types.d.ts +20 -2
package/build/index.cjs
CHANGED
|
@@ -590,6 +590,20 @@ const GLOBAL_CONFIG = {
|
|
|
590
590
|
* Default: false (PPPL logic is only applied when it does not break the direction of exits, ensuring clearer profit/loss outcomes)
|
|
591
591
|
*/
|
|
592
592
|
CC_ENABLE_PPPL_EVERYWHERE: false,
|
|
593
|
+
/**
|
|
594
|
+
* Enables long signals in strategies that are primarily designed for short signals.
|
|
595
|
+
* This allows the strategy to generate and manage long signals in addition to short signals, even if the original design was focused on short trading.
|
|
596
|
+
* This can help expand the strategy's applicability and take advantage of bullish market conditions, but may require additional logic to manage long signal behavior effectively.
|
|
597
|
+
*
|
|
598
|
+
* Default: false (long signals are only enabled in strategies that are designed for them, ensuring strategy logic is aligned with signal types)
|
|
599
|
+
*/
|
|
600
|
+
CC_ENABLE_LONG_SIGNAL: true,
|
|
601
|
+
/**
|
|
602
|
+
* Enables short signals in strategies that are primarily designed for long signals.
|
|
603
|
+
* This allows the strategy to generate and manage short signals in addition to long signals, even if the original design was focused on long trading.
|
|
604
|
+
* This can help expand the strategy's applicability and take advantage of bearish market conditions, but may require additional logic to manage short signal behavior effectively.
|
|
605
|
+
*/
|
|
606
|
+
CC_ENABLE_SHORT_SIGNAL: true,
|
|
593
607
|
/**
|
|
594
608
|
* Enables trailing logic (Trailing Take / Trailing Stop) without requiring absorption conditions.
|
|
595
609
|
* Allows trailing mechanisms to be activated regardless of whether absorption has been detected.
|
|
@@ -4710,6 +4724,12 @@ const validateCommonSignal = (signal) => {
|
|
|
4710
4724
|
if (signal.position !== "long" && signal.position !== "short") {
|
|
4711
4725
|
errors.push(`position must be "long" or "short", got "${signal.position}"`);
|
|
4712
4726
|
}
|
|
4727
|
+
if (signal.position === "long" && !GLOBAL_CONFIG.CC_ENABLE_LONG_SIGNAL) {
|
|
4728
|
+
errors.push(`Long signals are disabled (CC_ENABLE_LONG_SIGNAL=false)`);
|
|
4729
|
+
}
|
|
4730
|
+
if (signal.position === "short" && !GLOBAL_CONFIG.CC_ENABLE_SHORT_SIGNAL) {
|
|
4731
|
+
errors.push(`Short signals are disabled (CC_ENABLE_SHORT_SIGNAL=false)`);
|
|
4732
|
+
}
|
|
4713
4733
|
}
|
|
4714
4734
|
// ЗАЩИТА ОТ NaN/Infinity: все цены должны быть конечными числами
|
|
4715
4735
|
{
|
|
@@ -50883,7 +50903,8 @@ class DumpAdapter {
|
|
|
50883
50903
|
const unClose = signalEmitter
|
|
50884
50904
|
.filter(({ action }) => action === "closed")
|
|
50885
50905
|
.connect(({ signal }) => handleDispose(signal.id));
|
|
50886
|
-
|
|
50906
|
+
const unEnable = () => this.enable.clear();
|
|
50907
|
+
return functoolsKit.compose(() => unCancel(), () => unClose(), () => unEnable());
|
|
50887
50908
|
});
|
|
50888
50909
|
/**
|
|
50889
50910
|
* Deactivates the adapter by unsubscribing from signal lifecycle events.
|
|
@@ -51570,7 +51591,7 @@ class ReportUtils {
|
|
|
51570
51591
|
*
|
|
51571
51592
|
* @returns Cleanup function that unsubscribes from all enabled services
|
|
51572
51593
|
*/
|
|
51573
|
-
this.enable = ({ backtest: bt = false, breakeven = false, heat = false, live = false, partial = false, performance = false, risk = false, schedule = false, walker = false, strategy = false, sync = false, highest_profit = false, max_drawdown = false, } = WILDCARD_TARGET$2) => {
|
|
51594
|
+
this.enable = functoolsKit.singleshot(({ backtest: bt = false, breakeven = false, heat = false, live = false, partial = false, performance = false, risk = false, schedule = false, walker = false, strategy = false, sync = false, highest_profit = false, max_drawdown = false, } = WILDCARD_TARGET$2) => {
|
|
51574
51595
|
LOGGER_SERVICE$2.debug(REPORT_UTILS_METHOD_NAME_ENABLE, {
|
|
51575
51596
|
backtest: bt,
|
|
51576
51597
|
breakeven,
|
|
@@ -51624,8 +51645,11 @@ class ReportUtils {
|
|
|
51624
51645
|
if (max_drawdown) {
|
|
51625
51646
|
unList.push(backtest.maxDrawdownReportService.subscribe());
|
|
51626
51647
|
}
|
|
51648
|
+
{
|
|
51649
|
+
unList.push(() => this.enable.clear());
|
|
51650
|
+
}
|
|
51627
51651
|
return functoolsKit.compose(...unList.map((un) => () => void un()));
|
|
51628
|
-
};
|
|
51652
|
+
});
|
|
51629
51653
|
/**
|
|
51630
51654
|
* Disables report services selectively.
|
|
51631
51655
|
*
|
|
@@ -51676,6 +51700,11 @@ class ReportUtils {
|
|
|
51676
51700
|
strategy,
|
|
51677
51701
|
sync,
|
|
51678
51702
|
});
|
|
51703
|
+
if (this.enable.hasValue()) {
|
|
51704
|
+
const lastSubscription = this.enable();
|
|
51705
|
+
lastSubscription();
|
|
51706
|
+
return;
|
|
51707
|
+
}
|
|
51679
51708
|
if (bt) {
|
|
51680
51709
|
backtest.backtestReportService.unsubscribe();
|
|
51681
51710
|
}
|
|
@@ -51837,7 +51866,7 @@ class MarkdownUtils {
|
|
|
51837
51866
|
*
|
|
51838
51867
|
* @returns Cleanup function that unsubscribes from all enabled services
|
|
51839
51868
|
*/
|
|
51840
|
-
this.enable = ({ backtest: bt = false, breakeven = false, heat = false, live = false, partial = false, performance = false, strategy = false, risk = false, schedule = false, walker = false, sync = false, highest_profit = false, max_drawdown = false, } = WILDCARD_TARGET$1) => {
|
|
51869
|
+
this.enable = functoolsKit.singleshot(({ backtest: bt = false, breakeven = false, heat = false, live = false, partial = false, performance = false, strategy = false, risk = false, schedule = false, walker = false, sync = false, highest_profit = false, max_drawdown = false, } = WILDCARD_TARGET$1) => {
|
|
51841
51870
|
LOGGER_SERVICE$1.debug(MARKDOWN_METHOD_NAME_ENABLE, {
|
|
51842
51871
|
backtest: bt,
|
|
51843
51872
|
breakeven,
|
|
@@ -51892,8 +51921,11 @@ class MarkdownUtils {
|
|
|
51892
51921
|
if (max_drawdown) {
|
|
51893
51922
|
unList.push(backtest.maxDrawdownMarkdownService.subscribe());
|
|
51894
51923
|
}
|
|
51924
|
+
{
|
|
51925
|
+
unList.push(() => this.enable.clear());
|
|
51926
|
+
}
|
|
51895
51927
|
return functoolsKit.compose(...unList.map((un) => () => void un()));
|
|
51896
|
-
};
|
|
51928
|
+
});
|
|
51897
51929
|
/**
|
|
51898
51930
|
* Disables markdown report services selectively.
|
|
51899
51931
|
*
|
|
@@ -51946,6 +51978,11 @@ class MarkdownUtils {
|
|
|
51946
51978
|
sync,
|
|
51947
51979
|
highest_profit,
|
|
51948
51980
|
});
|
|
51981
|
+
if (this.enable.hasValue()) {
|
|
51982
|
+
const lastSubscription = this.enable();
|
|
51983
|
+
lastSubscription();
|
|
51984
|
+
return;
|
|
51985
|
+
}
|
|
51949
51986
|
if (bt) {
|
|
51950
51987
|
backtest.backtestMarkdownService.unsubscribe();
|
|
51951
51988
|
}
|
package/build/index.mjs
CHANGED
|
@@ -570,6 +570,20 @@ const GLOBAL_CONFIG = {
|
|
|
570
570
|
* Default: false (PPPL logic is only applied when it does not break the direction of exits, ensuring clearer profit/loss outcomes)
|
|
571
571
|
*/
|
|
572
572
|
CC_ENABLE_PPPL_EVERYWHERE: false,
|
|
573
|
+
/**
|
|
574
|
+
* Enables long signals in strategies that are primarily designed for short signals.
|
|
575
|
+
* This allows the strategy to generate and manage long signals in addition to short signals, even if the original design was focused on short trading.
|
|
576
|
+
* This can help expand the strategy's applicability and take advantage of bullish market conditions, but may require additional logic to manage long signal behavior effectively.
|
|
577
|
+
*
|
|
578
|
+
* Default: false (long signals are only enabled in strategies that are designed for them, ensuring strategy logic is aligned with signal types)
|
|
579
|
+
*/
|
|
580
|
+
CC_ENABLE_LONG_SIGNAL: true,
|
|
581
|
+
/**
|
|
582
|
+
* Enables short signals in strategies that are primarily designed for long signals.
|
|
583
|
+
* This allows the strategy to generate and manage short signals in addition to long signals, even if the original design was focused on long trading.
|
|
584
|
+
* This can help expand the strategy's applicability and take advantage of bearish market conditions, but may require additional logic to manage short signal behavior effectively.
|
|
585
|
+
*/
|
|
586
|
+
CC_ENABLE_SHORT_SIGNAL: true,
|
|
573
587
|
/**
|
|
574
588
|
* Enables trailing logic (Trailing Take / Trailing Stop) without requiring absorption conditions.
|
|
575
589
|
* Allows trailing mechanisms to be activated regardless of whether absorption has been detected.
|
|
@@ -4690,6 +4704,12 @@ const validateCommonSignal = (signal) => {
|
|
|
4690
4704
|
if (signal.position !== "long" && signal.position !== "short") {
|
|
4691
4705
|
errors.push(`position must be "long" or "short", got "${signal.position}"`);
|
|
4692
4706
|
}
|
|
4707
|
+
if (signal.position === "long" && !GLOBAL_CONFIG.CC_ENABLE_LONG_SIGNAL) {
|
|
4708
|
+
errors.push(`Long signals are disabled (CC_ENABLE_LONG_SIGNAL=false)`);
|
|
4709
|
+
}
|
|
4710
|
+
if (signal.position === "short" && !GLOBAL_CONFIG.CC_ENABLE_SHORT_SIGNAL) {
|
|
4711
|
+
errors.push(`Short signals are disabled (CC_ENABLE_SHORT_SIGNAL=false)`);
|
|
4712
|
+
}
|
|
4693
4713
|
}
|
|
4694
4714
|
// ЗАЩИТА ОТ NaN/Infinity: все цены должны быть конечными числами
|
|
4695
4715
|
{
|
|
@@ -50863,7 +50883,8 @@ class DumpAdapter {
|
|
|
50863
50883
|
const unClose = signalEmitter
|
|
50864
50884
|
.filter(({ action }) => action === "closed")
|
|
50865
50885
|
.connect(({ signal }) => handleDispose(signal.id));
|
|
50866
|
-
|
|
50886
|
+
const unEnable = () => this.enable.clear();
|
|
50887
|
+
return compose(() => unCancel(), () => unClose(), () => unEnable());
|
|
50867
50888
|
});
|
|
50868
50889
|
/**
|
|
50869
50890
|
* Deactivates the adapter by unsubscribing from signal lifecycle events.
|
|
@@ -51550,7 +51571,7 @@ class ReportUtils {
|
|
|
51550
51571
|
*
|
|
51551
51572
|
* @returns Cleanup function that unsubscribes from all enabled services
|
|
51552
51573
|
*/
|
|
51553
|
-
this.enable = ({ backtest: bt = false, breakeven = false, heat = false, live = false, partial = false, performance = false, risk = false, schedule = false, walker = false, strategy = false, sync = false, highest_profit = false, max_drawdown = false, } = WILDCARD_TARGET$2) => {
|
|
51574
|
+
this.enable = singleshot(({ backtest: bt = false, breakeven = false, heat = false, live = false, partial = false, performance = false, risk = false, schedule = false, walker = false, strategy = false, sync = false, highest_profit = false, max_drawdown = false, } = WILDCARD_TARGET$2) => {
|
|
51554
51575
|
LOGGER_SERVICE$2.debug(REPORT_UTILS_METHOD_NAME_ENABLE, {
|
|
51555
51576
|
backtest: bt,
|
|
51556
51577
|
breakeven,
|
|
@@ -51604,8 +51625,11 @@ class ReportUtils {
|
|
|
51604
51625
|
if (max_drawdown) {
|
|
51605
51626
|
unList.push(backtest.maxDrawdownReportService.subscribe());
|
|
51606
51627
|
}
|
|
51628
|
+
{
|
|
51629
|
+
unList.push(() => this.enable.clear());
|
|
51630
|
+
}
|
|
51607
51631
|
return compose(...unList.map((un) => () => void un()));
|
|
51608
|
-
};
|
|
51632
|
+
});
|
|
51609
51633
|
/**
|
|
51610
51634
|
* Disables report services selectively.
|
|
51611
51635
|
*
|
|
@@ -51656,6 +51680,11 @@ class ReportUtils {
|
|
|
51656
51680
|
strategy,
|
|
51657
51681
|
sync,
|
|
51658
51682
|
});
|
|
51683
|
+
if (this.enable.hasValue()) {
|
|
51684
|
+
const lastSubscription = this.enable();
|
|
51685
|
+
lastSubscription();
|
|
51686
|
+
return;
|
|
51687
|
+
}
|
|
51659
51688
|
if (bt) {
|
|
51660
51689
|
backtest.backtestReportService.unsubscribe();
|
|
51661
51690
|
}
|
|
@@ -51817,7 +51846,7 @@ class MarkdownUtils {
|
|
|
51817
51846
|
*
|
|
51818
51847
|
* @returns Cleanup function that unsubscribes from all enabled services
|
|
51819
51848
|
*/
|
|
51820
|
-
this.enable = ({ backtest: bt = false, breakeven = false, heat = false, live = false, partial = false, performance = false, strategy = false, risk = false, schedule = false, walker = false, sync = false, highest_profit = false, max_drawdown = false, } = WILDCARD_TARGET$1) => {
|
|
51849
|
+
this.enable = singleshot(({ backtest: bt = false, breakeven = false, heat = false, live = false, partial = false, performance = false, strategy = false, risk = false, schedule = false, walker = false, sync = false, highest_profit = false, max_drawdown = false, } = WILDCARD_TARGET$1) => {
|
|
51821
51850
|
LOGGER_SERVICE$1.debug(MARKDOWN_METHOD_NAME_ENABLE, {
|
|
51822
51851
|
backtest: bt,
|
|
51823
51852
|
breakeven,
|
|
@@ -51872,8 +51901,11 @@ class MarkdownUtils {
|
|
|
51872
51901
|
if (max_drawdown) {
|
|
51873
51902
|
unList.push(backtest.maxDrawdownMarkdownService.subscribe());
|
|
51874
51903
|
}
|
|
51904
|
+
{
|
|
51905
|
+
unList.push(() => this.enable.clear());
|
|
51906
|
+
}
|
|
51875
51907
|
return compose(...unList.map((un) => () => void un()));
|
|
51876
|
-
};
|
|
51908
|
+
});
|
|
51877
51909
|
/**
|
|
51878
51910
|
* Disables markdown report services selectively.
|
|
51879
51911
|
*
|
|
@@ -51926,6 +51958,11 @@ class MarkdownUtils {
|
|
|
51926
51958
|
sync,
|
|
51927
51959
|
highest_profit,
|
|
51928
51960
|
});
|
|
51961
|
+
if (this.enable.hasValue()) {
|
|
51962
|
+
const lastSubscription = this.enable();
|
|
51963
|
+
lastSubscription();
|
|
51964
|
+
return;
|
|
51965
|
+
}
|
|
51929
51966
|
if (bt) {
|
|
51930
51967
|
backtest.backtestMarkdownService.unsubscribe();
|
|
51931
51968
|
}
|
package/package.json
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "backtest-kit",
|
|
3
|
-
"version": "8.
|
|
4
|
-
"description": "A TypeScript library for trading system backtest",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Petr Tripolsky",
|
|
7
|
-
"email": "tripolskypetr@gmail.com",
|
|
8
|
-
"url": "https://github.com/tripolskypetr"
|
|
9
|
-
},
|
|
10
|
-
"funding": {
|
|
11
|
-
"type": "individual",
|
|
12
|
-
"url": "http://paypal.me/tripolskypetr"
|
|
13
|
-
},
|
|
14
|
-
"license": "MIT",
|
|
15
|
-
"homepage": "https://backtest-kit.github.io/documents/article_07_ai_news_trading_signals.html",
|
|
16
|
-
"keywords": [
|
|
17
|
-
"backtesting",
|
|
18
|
-
"backtest",
|
|
19
|
-
"finance",
|
|
20
|
-
"trading",
|
|
21
|
-
"candles",
|
|
22
|
-
"indicators",
|
|
23
|
-
"multi value",
|
|
24
|
-
"multi symbol",
|
|
25
|
-
"framework"
|
|
26
|
-
],
|
|
27
|
-
"files": [
|
|
28
|
-
"build",
|
|
29
|
-
"types.d.ts",
|
|
30
|
-
"README.md"
|
|
31
|
-
],
|
|
32
|
-
"repository": {
|
|
33
|
-
"type": "git",
|
|
34
|
-
"url": "https://github.com/tripolskypetr/backtest-kit",
|
|
35
|
-
"documentation": "https://github.com/tripolskypetr/backtest-kit/tree/master/docs"
|
|
36
|
-
},
|
|
37
|
-
"bugs": {
|
|
38
|
-
"url": "https://github.com/tripolskypetr/backtest-kit/issues"
|
|
39
|
-
},
|
|
40
|
-
"scripts": {
|
|
41
|
-
"build": "rollup -c",
|
|
42
|
-
"test": "npm run build && node ./test/index.mjs",
|
|
43
|
-
"build:docs": "rimraf docs && mkdir docs && node ./scripts/dts-docs.cjs ./types.d.ts ./docs",
|
|
44
|
-
"docs:gpt": "npm run build && node ./tools/gpt-docs/index.mjs",
|
|
45
|
-
"docs:uml": "npm run build && node ./scripts/uml.mjs",
|
|
46
|
-
"docs:www": "rimraf docs/wwwroot && node ./tools/typedoc-packages-docs/index.mjs && typedoc && node ./tools/typedoc-yandex-metrica/index.mjs",
|
|
47
|
-
"repl": "dotenv -e .env -- npm run build && node -e \"import('./scripts/repl.mjs')\" --interactive"
|
|
48
|
-
},
|
|
49
|
-
"main": "build/index.cjs",
|
|
50
|
-
"module": "build/index.mjs",
|
|
51
|
-
"source": "src/index.ts",
|
|
52
|
-
"types": "./types.d.ts",
|
|
53
|
-
"exports": {
|
|
54
|
-
"require": "./build/index.cjs",
|
|
55
|
-
"types": "./types.d.ts",
|
|
56
|
-
"import": "./build/index.mjs",
|
|
57
|
-
"default": "./build/index.cjs"
|
|
58
|
-
},
|
|
59
|
-
"devDependencies": {
|
|
60
|
-
"@rollup/plugin-typescript": "11.1.6",
|
|
61
|
-
"@types/node": "22.9.0",
|
|
62
|
-
"glob": "11.0.1",
|
|
63
|
-
"plantuml": "0.0.2",
|
|
64
|
-
"rimraf": "6.0.1",
|
|
65
|
-
"rollup": "3.29.5",
|
|
66
|
-
"rollup-plugin-dts": "6.1.1",
|
|
67
|
-
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
68
|
-
"ts-morph": "27.0.2",
|
|
69
|
-
"tslib": "2.7.0",
|
|
70
|
-
"typedoc": "0.27.9",
|
|
71
|
-
"worker-testbed": "2.0.0"
|
|
72
|
-
},
|
|
73
|
-
"peerDependencies": {
|
|
74
|
-
"typescript": "^5.0.0"
|
|
75
|
-
},
|
|
76
|
-
"dependencies": {
|
|
77
|
-
"di-kit": "^1.1.1",
|
|
78
|
-
"di-scoped": "^1.0.21",
|
|
79
|
-
"di-singleton": "^1.0.5",
|
|
80
|
-
"functools-kit": "^2.3.0",
|
|
81
|
-
"get-moment-stamp": "^1.1.2"
|
|
82
|
-
},
|
|
83
|
-
"publishConfig": {
|
|
84
|
-
"access": "public"
|
|
85
|
-
}
|
|
86
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "backtest-kit",
|
|
3
|
+
"version": "8.1.0",
|
|
4
|
+
"description": "A TypeScript library for trading system backtest",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Petr Tripolsky",
|
|
7
|
+
"email": "tripolskypetr@gmail.com",
|
|
8
|
+
"url": "https://github.com/tripolskypetr"
|
|
9
|
+
},
|
|
10
|
+
"funding": {
|
|
11
|
+
"type": "individual",
|
|
12
|
+
"url": "http://paypal.me/tripolskypetr"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"homepage": "https://backtest-kit.github.io/documents/article_07_ai_news_trading_signals.html",
|
|
16
|
+
"keywords": [
|
|
17
|
+
"backtesting",
|
|
18
|
+
"backtest",
|
|
19
|
+
"finance",
|
|
20
|
+
"trading",
|
|
21
|
+
"candles",
|
|
22
|
+
"indicators",
|
|
23
|
+
"multi value",
|
|
24
|
+
"multi symbol",
|
|
25
|
+
"framework"
|
|
26
|
+
],
|
|
27
|
+
"files": [
|
|
28
|
+
"build",
|
|
29
|
+
"types.d.ts",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/tripolskypetr/backtest-kit",
|
|
35
|
+
"documentation": "https://github.com/tripolskypetr/backtest-kit/tree/master/docs"
|
|
36
|
+
},
|
|
37
|
+
"bugs": {
|
|
38
|
+
"url": "https://github.com/tripolskypetr/backtest-kit/issues"
|
|
39
|
+
},
|
|
40
|
+
"scripts": {
|
|
41
|
+
"build": "rollup -c",
|
|
42
|
+
"test": "npm run build && node ./test/index.mjs",
|
|
43
|
+
"build:docs": "rimraf docs && mkdir docs && node ./scripts/dts-docs.cjs ./types.d.ts ./docs",
|
|
44
|
+
"docs:gpt": "npm run build && node ./tools/gpt-docs/index.mjs",
|
|
45
|
+
"docs:uml": "npm run build && node ./scripts/uml.mjs",
|
|
46
|
+
"docs:www": "rimraf docs/wwwroot && node ./tools/typedoc-packages-docs/index.mjs && typedoc && node ./tools/typedoc-yandex-metrica/index.mjs",
|
|
47
|
+
"repl": "dotenv -e .env -- npm run build && node -e \"import('./scripts/repl.mjs')\" --interactive"
|
|
48
|
+
},
|
|
49
|
+
"main": "build/index.cjs",
|
|
50
|
+
"module": "build/index.mjs",
|
|
51
|
+
"source": "src/index.ts",
|
|
52
|
+
"types": "./types.d.ts",
|
|
53
|
+
"exports": {
|
|
54
|
+
"require": "./build/index.cjs",
|
|
55
|
+
"types": "./types.d.ts",
|
|
56
|
+
"import": "./build/index.mjs",
|
|
57
|
+
"default": "./build/index.cjs"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@rollup/plugin-typescript": "11.1.6",
|
|
61
|
+
"@types/node": "22.9.0",
|
|
62
|
+
"glob": "11.0.1",
|
|
63
|
+
"plantuml": "0.0.2",
|
|
64
|
+
"rimraf": "6.0.1",
|
|
65
|
+
"rollup": "3.29.5",
|
|
66
|
+
"rollup-plugin-dts": "6.1.1",
|
|
67
|
+
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
68
|
+
"ts-morph": "27.0.2",
|
|
69
|
+
"tslib": "2.7.0",
|
|
70
|
+
"typedoc": "0.27.9",
|
|
71
|
+
"worker-testbed": "2.0.0"
|
|
72
|
+
},
|
|
73
|
+
"peerDependencies": {
|
|
74
|
+
"typescript": "^5.0.0"
|
|
75
|
+
},
|
|
76
|
+
"dependencies": {
|
|
77
|
+
"di-kit": "^1.1.1",
|
|
78
|
+
"di-scoped": "^1.0.21",
|
|
79
|
+
"di-singleton": "^1.0.5",
|
|
80
|
+
"functools-kit": "^2.3.0",
|
|
81
|
+
"get-moment-stamp": "^1.1.2"
|
|
82
|
+
},
|
|
83
|
+
"publishConfig": {
|
|
84
|
+
"access": "public"
|
|
85
|
+
}
|
|
86
|
+
}
|
package/types.d.ts
CHANGED
|
@@ -6484,6 +6484,20 @@ declare const GLOBAL_CONFIG: {
|
|
|
6484
6484
|
* Default: false (PPPL logic is only applied when it does not break the direction of exits, ensuring clearer profit/loss outcomes)
|
|
6485
6485
|
*/
|
|
6486
6486
|
CC_ENABLE_PPPL_EVERYWHERE: boolean;
|
|
6487
|
+
/**
|
|
6488
|
+
* Enables long signals in strategies that are primarily designed for short signals.
|
|
6489
|
+
* This allows the strategy to generate and manage long signals in addition to short signals, even if the original design was focused on short trading.
|
|
6490
|
+
* This can help expand the strategy's applicability and take advantage of bullish market conditions, but may require additional logic to manage long signal behavior effectively.
|
|
6491
|
+
*
|
|
6492
|
+
* Default: false (long signals are only enabled in strategies that are designed for them, ensuring strategy logic is aligned with signal types)
|
|
6493
|
+
*/
|
|
6494
|
+
CC_ENABLE_LONG_SIGNAL: boolean;
|
|
6495
|
+
/**
|
|
6496
|
+
* Enables short signals in strategies that are primarily designed for long signals.
|
|
6497
|
+
* This allows the strategy to generate and manage short signals in addition to long signals, even if the original design was focused on long trading.
|
|
6498
|
+
* This can help expand the strategy's applicability and take advantage of bearish market conditions, but may require additional logic to manage short signal behavior effectively.
|
|
6499
|
+
*/
|
|
6500
|
+
CC_ENABLE_SHORT_SIGNAL: boolean;
|
|
6487
6501
|
/**
|
|
6488
6502
|
* Enables trailing logic (Trailing Take / Trailing Stop) without requiring absorption conditions.
|
|
6489
6503
|
* Allows trailing mechanisms to be activated regardless of whether absorption has been detected.
|
|
@@ -6632,6 +6646,8 @@ declare function getConfig(): {
|
|
|
6632
6646
|
CC_ENABLE_CANDLE_FETCH_MUTEX: boolean;
|
|
6633
6647
|
CC_ENABLE_DCA_EVERYWHERE: boolean;
|
|
6634
6648
|
CC_ENABLE_PPPL_EVERYWHERE: boolean;
|
|
6649
|
+
CC_ENABLE_LONG_SIGNAL: boolean;
|
|
6650
|
+
CC_ENABLE_SHORT_SIGNAL: boolean;
|
|
6635
6651
|
CC_ENABLE_TRAILING_EVERYWHERE: boolean;
|
|
6636
6652
|
CC_POSITION_ENTRY_COST: number;
|
|
6637
6653
|
};
|
|
@@ -6688,6 +6704,8 @@ declare function getDefaultConfig(): Readonly<{
|
|
|
6688
6704
|
CC_ENABLE_CANDLE_FETCH_MUTEX: boolean;
|
|
6689
6705
|
CC_ENABLE_DCA_EVERYWHERE: boolean;
|
|
6690
6706
|
CC_ENABLE_PPPL_EVERYWHERE: boolean;
|
|
6707
|
+
CC_ENABLE_LONG_SIGNAL: boolean;
|
|
6708
|
+
CC_ENABLE_SHORT_SIGNAL: boolean;
|
|
6691
6709
|
CC_ENABLE_TRAILING_EVERYWHERE: boolean;
|
|
6692
6710
|
CC_POSITION_ENTRY_COST: number;
|
|
6693
6711
|
}>;
|
|
@@ -14735,7 +14753,7 @@ declare class ReportUtils {
|
|
|
14735
14753
|
*
|
|
14736
14754
|
* @returns Cleanup function that unsubscribes from all enabled services
|
|
14737
14755
|
*/
|
|
14738
|
-
enable: ({ backtest: bt, breakeven, heat, live, partial, performance, risk, schedule, walker, strategy, sync, highest_profit, max_drawdown, }?: Partial<IReportTarget>) => (...args: any[]) => any
|
|
14756
|
+
enable: (({ backtest: bt, breakeven, heat, live, partial, performance, risk, schedule, walker, strategy, sync, highest_profit, max_drawdown, }?: Partial<IReportTarget>) => (...args: any[]) => any) & functools_kit.ISingleshotClearable<({ backtest: bt, breakeven, heat, live, partial, performance, risk, schedule, walker, strategy, sync, highest_profit, max_drawdown, }?: Partial<IReportTarget>) => (...args: any[]) => any>;
|
|
14739
14757
|
/**
|
|
14740
14758
|
* Disables report services selectively.
|
|
14741
14759
|
*
|
|
@@ -14852,7 +14870,7 @@ declare class MarkdownUtils {
|
|
|
14852
14870
|
*
|
|
14853
14871
|
* @returns Cleanup function that unsubscribes from all enabled services
|
|
14854
14872
|
*/
|
|
14855
|
-
enable: ({ backtest: bt, breakeven, heat, live, partial, performance, strategy, risk, schedule, walker, sync, highest_profit, max_drawdown, }?: Partial<IMarkdownTarget>) => (...args: any[]) => any
|
|
14873
|
+
enable: (({ backtest: bt, breakeven, heat, live, partial, performance, strategy, risk, schedule, walker, sync, highest_profit, max_drawdown, }?: Partial<IMarkdownTarget>) => (...args: any[]) => any) & functools_kit.ISingleshotClearable<({ backtest: bt, breakeven, heat, live, partial, performance, strategy, risk, schedule, walker, sync, highest_profit, max_drawdown, }?: Partial<IMarkdownTarget>) => (...args: any[]) => any>;
|
|
14856
14874
|
/**
|
|
14857
14875
|
* Disables markdown report services selectively.
|
|
14858
14876
|
*
|