@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.
@@ -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
+ };