@tradejs/strategies 1.0.5 → 1.0.8
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/dist/chunk-37ZWRG3W.mjs +128 -0
- package/dist/chunk-H4MHFD4B.mjs +62 -0
- package/dist/chunk-IMLNXICX.mjs +547 -0
- package/dist/chunk-QVWMBYYM.mjs +836 -0
- package/dist/chunk-SOVTOGY4.mjs +163 -0
- package/dist/chunk-TDUTYEGH.mjs +797 -0
- package/dist/chunk-UK4YHD2E.mjs +683 -0
- package/dist/index.d.mts +325 -4
- package/dist/index.d.ts +325 -4
- package/dist/index.js +5689 -1195
- package/dist/index.mjs +61 -14
- package/dist/{strategy-ZVNTA6UR.mjs → strategy-ABIO65CR.mjs} +3 -46
- package/dist/strategy-D7H5J3C4.mjs +348 -0
- package/dist/strategy-HQIPCUOY.mjs +399 -0
- package/dist/{strategy-Y4SOK6FF.mjs → strategy-JQIJILHQ.mjs} +28 -109
- package/dist/strategy-QEIPAPY4.mjs +373 -0
- package/dist/strategy-WYN4FZ5S.mjs +613 -0
- package/dist/{strategy-UHRWSGZC.mjs → strategy-XTUKPYPM.mjs} +484 -128
- package/package.json +5 -5
- package/dist/chunk-3PN7ZSJJ.mjs +0 -27
- package/dist/chunk-MVIV5ZII.mjs +0 -137
- package/dist/chunk-RDK2JK3K.mjs +0 -28
- package/dist/chunk-RYEPHOGL.mjs +0 -28
- package/dist/chunk-ULLCAH5C.mjs +0 -67
- package/dist/strategy-M3BRWDRR.mjs +0 -377
- package/dist/strategy-UZBWST3G.mjs +0 -156
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// src/Breakout/adapters/ai.ts
|
|
2
|
+
var breakoutAiAdapter = {};
|
|
3
|
+
|
|
4
|
+
// src/Breakout/adapters/ml.ts
|
|
5
|
+
import { mapMlRuntimeFromConfig } from "@tradejs/core/strategies";
|
|
6
|
+
var breakoutMlAdapter = {
|
|
7
|
+
mapEntryRuntimeFromConfig: (config2) => mapMlRuntimeFromConfig(config2)
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
// src/Breakout/manifest.ts
|
|
11
|
+
var breakoutManifest = {
|
|
12
|
+
name: "Breakout",
|
|
13
|
+
entryRuntimeDefaults: {
|
|
14
|
+
ai: {
|
|
15
|
+
enabled: false
|
|
16
|
+
},
|
|
17
|
+
ml: {
|
|
18
|
+
enabled: false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
aiAdapter: breakoutAiAdapter,
|
|
22
|
+
mlAdapter: breakoutMlAdapter
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// src/Breakout/config.ts
|
|
26
|
+
var config = {
|
|
27
|
+
ML_ENABLED: false,
|
|
28
|
+
MA_FAST: 49,
|
|
29
|
+
MA_MEDIUM: 49,
|
|
30
|
+
MA_SLOW: 99,
|
|
31
|
+
OBV_SMA: 10,
|
|
32
|
+
ATR: 14,
|
|
33
|
+
ATR_PCT_SHORT: 7,
|
|
34
|
+
ATR_PCT_LONG: 30,
|
|
35
|
+
BB: 20,
|
|
36
|
+
BB_STD: 2,
|
|
37
|
+
MACD_FAST: 12,
|
|
38
|
+
MACD_SLOW: 26,
|
|
39
|
+
MACD_SIGNAL: 9,
|
|
40
|
+
LEVEL_LOOKBACK: 20,
|
|
41
|
+
LEVEL_DELAY: 2,
|
|
42
|
+
ATR_PERIOD: 14,
|
|
43
|
+
BB_PERIOD: 20,
|
|
44
|
+
BB_STDDEV: 2,
|
|
45
|
+
LIMIT: 100,
|
|
46
|
+
ATR_OPEN: 0.5,
|
|
47
|
+
ATR_CLOSE: 1.5,
|
|
48
|
+
OBV_SMA_PERIOD: 10,
|
|
49
|
+
BREAKOUT_LOOKBACK_DELAY: 2,
|
|
50
|
+
BREAKOUT_LOOKBACK: 20,
|
|
51
|
+
REQUIRED_SCORE_LONG: 7,
|
|
52
|
+
REQUIRED_SCORE_SHORT: 7,
|
|
53
|
+
SIGNALS_LONG: {
|
|
54
|
+
VOLATILE: {
|
|
55
|
+
weight: 1,
|
|
56
|
+
required: true
|
|
57
|
+
},
|
|
58
|
+
SMA_UPTREND: {
|
|
59
|
+
weight: 1,
|
|
60
|
+
required: true
|
|
61
|
+
},
|
|
62
|
+
OBV_ABOVE_SMA: {
|
|
63
|
+
weight: 1,
|
|
64
|
+
required: true
|
|
65
|
+
},
|
|
66
|
+
PREV_HIGH_BREAKOUT: {
|
|
67
|
+
weight: 1,
|
|
68
|
+
required: false
|
|
69
|
+
},
|
|
70
|
+
CLOSE_ABOVE_UPPER_BB: {
|
|
71
|
+
weight: 1,
|
|
72
|
+
required: false
|
|
73
|
+
},
|
|
74
|
+
CLOSE_ABOVE_HIGH_LEVEL: {
|
|
75
|
+
weight: 1,
|
|
76
|
+
required: false
|
|
77
|
+
},
|
|
78
|
+
CLOSE_ABOVE_PREV_CLOSE: {
|
|
79
|
+
weight: 1,
|
|
80
|
+
required: false
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
SIGNALS_SHORT: {
|
|
84
|
+
VOLATILE: {
|
|
85
|
+
weight: 1,
|
|
86
|
+
required: true
|
|
87
|
+
},
|
|
88
|
+
SMA_DOWNTREND: {
|
|
89
|
+
weight: 1,
|
|
90
|
+
required: true
|
|
91
|
+
},
|
|
92
|
+
OBV_BELOW_SMA: {
|
|
93
|
+
weight: 1,
|
|
94
|
+
required: true
|
|
95
|
+
},
|
|
96
|
+
PREV_LOW_BREAKDOWN: {
|
|
97
|
+
weight: 1,
|
|
98
|
+
required: false
|
|
99
|
+
},
|
|
100
|
+
CLOSE_BELOW_LOWER_BB: {
|
|
101
|
+
weight: 1,
|
|
102
|
+
required: false
|
|
103
|
+
},
|
|
104
|
+
CLOSE_BELOW_LOW_LEVEL: {
|
|
105
|
+
weight: 1,
|
|
106
|
+
required: false
|
|
107
|
+
},
|
|
108
|
+
CLOSE_BELOW_PREV_CLOSE: {
|
|
109
|
+
weight: 1,
|
|
110
|
+
required: false
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
TP_LONG: [
|
|
114
|
+
{ profit: 0.1, rate: 0.25 },
|
|
115
|
+
{ profit: 0.15, rate: 0.5 }
|
|
116
|
+
],
|
|
117
|
+
TP_SHORT: [
|
|
118
|
+
{ profit: 0.05, rate: 0.25 },
|
|
119
|
+
{ profit: 0.1, rate: 0.5 }
|
|
120
|
+
],
|
|
121
|
+
SL_LONG: 0.06,
|
|
122
|
+
SL_SHORT: 0.03
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export {
|
|
126
|
+
breakoutManifest,
|
|
127
|
+
config
|
|
128
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// src/MaStrategy/adapters/ai.ts
|
|
2
|
+
import { mapAiRuntimeFromConfig } from "@tradejs/core/strategies";
|
|
3
|
+
var maStrategyAiAdapter = {
|
|
4
|
+
mapEntryRuntimeFromConfig: (config2) => mapAiRuntimeFromConfig(
|
|
5
|
+
config2
|
|
6
|
+
)
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
// src/MaStrategy/adapters/ml.ts
|
|
10
|
+
import { mapMlRuntimeFromConfig } from "@tradejs/core/strategies";
|
|
11
|
+
var maStrategyMlAdapter = {
|
|
12
|
+
mapEntryRuntimeFromConfig: (config2) => mapMlRuntimeFromConfig(
|
|
13
|
+
config2
|
|
14
|
+
)
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
// src/MaStrategy/manifest.ts
|
|
18
|
+
var maStrategyManifest = {
|
|
19
|
+
name: "MaStrategy",
|
|
20
|
+
aiAdapter: maStrategyAiAdapter,
|
|
21
|
+
mlAdapter: maStrategyMlAdapter
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
// src/MaStrategy/config.ts
|
|
25
|
+
var config = {
|
|
26
|
+
ENV: "BACKTEST",
|
|
27
|
+
INTERVAL: "15",
|
|
28
|
+
MAKE_ORDERS: true,
|
|
29
|
+
CLOSE_OPPOSITE_POSITIONS: false,
|
|
30
|
+
BACKTEST_PRICE_MODE: "mid",
|
|
31
|
+
AI_ENABLED: false,
|
|
32
|
+
AI_MODE: "llm",
|
|
33
|
+
ML_ENABLED: false,
|
|
34
|
+
ML_THRESHOLD: 0.1,
|
|
35
|
+
MIN_AI_QUALITY: 3,
|
|
36
|
+
FEE_PERCENT: 5e-3,
|
|
37
|
+
MAX_LOSS_VALUE: 10,
|
|
38
|
+
TRADE_COOLDOWN_MS: 0,
|
|
39
|
+
MA_FAST: 21,
|
|
40
|
+
MA_SLOW: 55,
|
|
41
|
+
LONG: {
|
|
42
|
+
enable: true,
|
|
43
|
+
direction: "LONG",
|
|
44
|
+
TP: 2,
|
|
45
|
+
SL: 1,
|
|
46
|
+
minRiskRatio: 1.5
|
|
47
|
+
},
|
|
48
|
+
SHORT: {
|
|
49
|
+
enable: true,
|
|
50
|
+
direction: "SHORT",
|
|
51
|
+
TP: 2,
|
|
52
|
+
SL: 1,
|
|
53
|
+
minRiskRatio: 1.5
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export {
|
|
58
|
+
maStrategyAiAdapter,
|
|
59
|
+
maStrategyMlAdapter,
|
|
60
|
+
maStrategyManifest,
|
|
61
|
+
config
|
|
62
|
+
};
|