@tradejs/strategies 2.0.6 → 2.0.7

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/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Interval, TrendLineOptions, StrategyAiAdapter, StrategyMlAdapter, StrategyRegistryEntry, StrategyConfig } from '@tradejs/types';
2
2
 
3
3
  type AdaptiveMomentumRibbonKcMaType = 'SMA' | 'EMA' | 'SMMA (RMA)' | 'WMA' | 'VWMA';
4
- declare const config$g: {
4
+ declare const config$h: {
5
5
  readonly ENV: "BACKTEST";
6
6
  readonly INTERVAL: Interval;
7
7
  readonly MAKE_ORDERS: true;
@@ -44,7 +44,7 @@ declare const config$g: {
44
44
  };
45
45
  };
46
46
 
47
- declare const config$f: {
47
+ declare const config$g: {
48
48
  readonly ENV: "BACKTEST";
49
49
  readonly INTERVAL: Interval;
50
50
  readonly MAKE_ORDERS: true;
@@ -95,7 +95,7 @@ declare const config$f: {
95
95
  };
96
96
  };
97
97
 
98
- declare const config$e: {
98
+ declare const config$f: {
99
99
  ML_ENABLED: boolean;
100
100
  MA_FAST: number;
101
101
  MA_MEDIUM: number;
@@ -194,7 +194,7 @@ declare const config$e: {
194
194
  SL_SHORT: number;
195
195
  };
196
196
 
197
- declare const config$d: {
197
+ declare const config$e: {
198
198
  readonly ENV: "BACKTEST";
199
199
  readonly INTERVAL: Interval;
200
200
  readonly MAKE_ORDERS: true;
@@ -243,7 +243,7 @@ declare const config$d: {
243
243
  };
244
244
  };
245
245
 
246
- declare const config$c: {
246
+ declare const config$d: {
247
247
  readonly ENV: "BACKTEST";
248
248
  readonly INTERVAL: Interval;
249
249
  readonly MAKE_ORDERS: true;
@@ -287,7 +287,9 @@ declare const config$c: {
287
287
  };
288
288
  };
289
289
 
290
- declare const config$b: {
290
+ type GridRangeFilterMode = 'off' | 'block_entries' | 'block_all' | 'edge_all';
291
+
292
+ declare const config$c: {
291
293
  readonly ENV: "BACKTEST";
292
294
  readonly INTERVAL: Interval;
293
295
  readonly MAKE_ORDERS: true;
@@ -333,6 +335,86 @@ declare const config$b: {
333
335
  readonly GRID_ENTRY_COOLDOWN_BARS: 8;
334
336
  readonly GRID_PROTECTION_REPRICE_ATR: 0.15;
335
337
  readonly GRID_MAX_FIGURE_POINTS: 160;
338
+ readonly GRID_RANGE_FILTER_MODE: GridRangeFilterMode;
339
+ readonly GRID_RANGE_PIVOT_LEFT_BARS: 3;
340
+ readonly GRID_RANGE_PIVOT_RIGHT_BARS: 3;
341
+ readonly GRID_RANGE_LOOKBACK_BARS: 96;
342
+ readonly GRID_RANGE_MIN_PIVOTS_PER_SIDE: 2;
343
+ readonly GRID_RANGE_MIN_WIDTH_ATR: 3;
344
+ readonly GRID_RANGE_MAX_WIDTH_ATR: 18;
345
+ readonly GRID_RANGE_MAX_CENTER_SLOPE_ATR_PER_BAR: 0.03;
346
+ readonly GRID_RANGE_MAX_BOUNDARY_DIVERGENCE_ATR: 1;
347
+ readonly GRID_RANGE_MIN_CONTAINMENT_RATIO: 0.75;
348
+ readonly GRID_RANGE_CONTAINMENT_TOLERANCE_ATR: 0.2;
349
+ readonly GRID_RANGE_EDGE_FRACTION: 0.35;
350
+ readonly LONG: {
351
+ readonly enable: true;
352
+ readonly direction: "LONG";
353
+ };
354
+ readonly SHORT: {
355
+ readonly enable: true;
356
+ readonly direction: "SHORT";
357
+ };
358
+ };
359
+
360
+ type GridClassicTakeProfitMode = 'center' | 'opposite_edge';
361
+ type GridClassicEntryConfirmation = 'rejection' | 'close_inside' | 'either';
362
+ declare const config$b: {
363
+ readonly ENV: "BACKTEST";
364
+ readonly INTERVAL: Interval;
365
+ readonly MAKE_ORDERS: true;
366
+ readonly CLOSE_OPPOSITE_POSITIONS: false;
367
+ readonly BACKTEST_PRICE_MODE: "open";
368
+ readonly AI_ENABLED: false;
369
+ readonly AI_MODE: "llm";
370
+ readonly ML_ENABLED: false;
371
+ readonly ML_THRESHOLD: 0.1;
372
+ readonly MIN_AI_QUALITY: 3;
373
+ readonly FEE_PERCENT: 0.001;
374
+ readonly MAX_LOSS_VALUE: 10;
375
+ readonly MA_FAST: 20;
376
+ readonly MA_MEDIUM: 50;
377
+ readonly MA_SLOW: 100;
378
+ readonly OBV_SMA: 10;
379
+ readonly ATR: 14;
380
+ readonly ATR_PCT_SHORT: 7;
381
+ readonly ATR_PCT_LONG: 30;
382
+ readonly BB: 20;
383
+ readonly BB_STD: 2;
384
+ readonly MACD_FAST: 12;
385
+ readonly MACD_SLOW: 26;
386
+ readonly MACD_SIGNAL: 9;
387
+ readonly GRIDCLASSIC_ATR_PERIOD: 14;
388
+ readonly GRIDCLASSIC_PIVOT_LEFT_BARS: 3;
389
+ readonly GRIDCLASSIC_PIVOT_RIGHT_BARS: 3;
390
+ readonly GRIDCLASSIC_LOOKBACK_BARS: 96;
391
+ readonly GRIDCLASSIC_MIN_PIVOTS_PER_SIDE: 3;
392
+ readonly GRIDCLASSIC_MIN_WIDTH_ATR: 3;
393
+ readonly GRIDCLASSIC_MAX_WIDTH_ATR: 14;
394
+ readonly GRIDCLASSIC_MAX_CENTER_SLOPE_ATR_PER_BAR: 0.015;
395
+ readonly GRIDCLASSIC_MAX_BOUNDARY_DIVERGENCE_ATR: 0.8;
396
+ readonly GRIDCLASSIC_MIN_CONTAINMENT_RATIO: 0.9;
397
+ readonly GRIDCLASSIC_CONTAINMENT_TOLERANCE_ATR: 0.2;
398
+ readonly GRIDCLASSIC_BREAKOUT_TOLERANCE_ATR: 0.25;
399
+ readonly GRIDCLASSIC_MIN_RANGE_AGE_BARS: 32;
400
+ readonly GRIDCLASSIC_MAX_VOLATILITY_EXPANSION: 1.8;
401
+ readonly GRIDCLASSIC_MAX_CANDLE_RANGE_ATR: 3;
402
+ readonly GRIDCLASSIC_EDGE_ZONE_FRACTION: 0.12;
403
+ readonly GRIDCLASSIC_ENTRY_CONFIRMATION: GridClassicEntryConfirmation;
404
+ readonly GRIDCLASSIC_MIN_REJECTION_WICK_RATIO: 1.5;
405
+ readonly GRIDCLASSIC_LEVELS: 4;
406
+ readonly GRIDCLASSIC_GRID_STEP_ATR: 0.3;
407
+ readonly GRIDCLASSIC_GRID_STEP_RANGE_FRACTION: 0.1;
408
+ readonly GRIDCLASSIC_LEVEL_SIZE_DECAY: 1;
409
+ readonly GRIDCLASSIC_STOP_ATR_BUFFER: 1.5;
410
+ readonly GRIDCLASSIC_TP_MODE: GridClassicTakeProfitMode;
411
+ readonly GRIDCLASSIC_BREAKOUT_CONFIRM_BARS: 1;
412
+ readonly GRIDCLASSIC_INVALIDATION_BARS: 3;
413
+ readonly GRIDCLASSIC_MAX_HOLD_BARS: 192;
414
+ readonly GRIDCLASSIC_COOLDOWN_BARS: 16;
415
+ readonly GRIDCLASSIC_RISK_SLIPPAGE_BPS: 10;
416
+ readonly GRIDCLASSIC_PROTECTION_REPRICE_ATR: 0.15;
417
+ readonly GRIDCLASSIC_MAX_FIGURE_POINTS: 180;
336
418
  readonly LONG: {
337
419
  readonly enable: true;
338
420
  readonly direction: "LONG";
@@ -877,6 +959,8 @@ declare const doubleTapAiAdapter: StrategyAiAdapter;
877
959
 
878
960
  declare const gridAiAdapter: StrategyAiAdapter;
879
961
 
962
+ declare const gridClassicAiAdapter: StrategyAiAdapter;
963
+
880
964
  declare const liquidityTailsAiAdapter: StrategyAiAdapter;
881
965
 
882
966
  declare const liquidityZonesAiAdapter: StrategyAiAdapter;
@@ -898,4 +982,4 @@ declare const _default: {
898
982
  strategyEntries: StrategyRegistryEntry[];
899
983
  };
900
984
 
901
- export { adaptiveMomentumRibbonAiAdapter, config$g as adaptiveMomentumRibbonDefaultConfig, adaptiveMomentumRibbonMlAdapter, adaptiveTrendChannelAiAdapter, config$f as adaptiveTrendChannelDefaultConfig, config$e as breakoutDefaultConfig, _default as default, doubleTapAiAdapter, config$c as doubleTapDefaultConfig, getBuiltInStrategyDefaultConfig, gridAiAdapter, config$b as gridDefaultConfig, liquidityTailsAiAdapter, config$8 as liquidityTailsDefaultConfig, liquidityZonesAiAdapter, config$7 as liquidityZonesDefaultConfig, maStrategyAiAdapter, config$a as maStrategyDefaultConfig, maStrategyMlAdapter, marketFlushReversalAiAdapter, config$d as marketFlushReversalDefaultConfig, relativeRotationAiAdapter, config$9 as relativeRotationDefaultConfig, reverseTrendLineAiAdapter, config$6 as reverseTrendLineDefaultConfig, strategyEntries, structureZonesAiAdapter, config$5 as structureZonesDefaultConfig, trendFollowAiAdapter, config$4 as trendFollowDefaultConfig, config$2 as trendLineDefaultConfig, trendShiftAiAdapter, config$3 as trendShiftDefaultConfig, volatilityCompressionBreakoutAiAdapter, config as volatilityCompressionBreakoutDefaultConfig, volumeDivergenceAiAdapter, config$1 as volumeDivergenceDefaultConfig, volumeDivergenceMlAdapter };
985
+ export { adaptiveMomentumRibbonAiAdapter, config$h as adaptiveMomentumRibbonDefaultConfig, adaptiveMomentumRibbonMlAdapter, adaptiveTrendChannelAiAdapter, config$g as adaptiveTrendChannelDefaultConfig, config$f as breakoutDefaultConfig, _default as default, doubleTapAiAdapter, config$d as doubleTapDefaultConfig, getBuiltInStrategyDefaultConfig, gridAiAdapter, gridClassicAiAdapter, config$b as gridClassicDefaultConfig, config$c as gridDefaultConfig, liquidityTailsAiAdapter, config$8 as liquidityTailsDefaultConfig, liquidityZonesAiAdapter, config$7 as liquidityZonesDefaultConfig, maStrategyAiAdapter, config$a as maStrategyDefaultConfig, maStrategyMlAdapter, marketFlushReversalAiAdapter, config$e as marketFlushReversalDefaultConfig, relativeRotationAiAdapter, config$9 as relativeRotationDefaultConfig, reverseTrendLineAiAdapter, config$6 as reverseTrendLineDefaultConfig, strategyEntries, structureZonesAiAdapter, config$5 as structureZonesDefaultConfig, trendFollowAiAdapter, config$4 as trendFollowDefaultConfig, config$2 as trendLineDefaultConfig, trendShiftAiAdapter, config$3 as trendShiftDefaultConfig, volatilityCompressionBreakoutAiAdapter, config as volatilityCompressionBreakoutDefaultConfig, volumeDivergenceAiAdapter, config$1 as volumeDivergenceDefaultConfig, volumeDivergenceMlAdapter };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Interval, TrendLineOptions, StrategyAiAdapter, StrategyMlAdapter, StrategyRegistryEntry, StrategyConfig } from '@tradejs/types';
2
2
 
3
3
  type AdaptiveMomentumRibbonKcMaType = 'SMA' | 'EMA' | 'SMMA (RMA)' | 'WMA' | 'VWMA';
4
- declare const config$g: {
4
+ declare const config$h: {
5
5
  readonly ENV: "BACKTEST";
6
6
  readonly INTERVAL: Interval;
7
7
  readonly MAKE_ORDERS: true;
@@ -44,7 +44,7 @@ declare const config$g: {
44
44
  };
45
45
  };
46
46
 
47
- declare const config$f: {
47
+ declare const config$g: {
48
48
  readonly ENV: "BACKTEST";
49
49
  readonly INTERVAL: Interval;
50
50
  readonly MAKE_ORDERS: true;
@@ -95,7 +95,7 @@ declare const config$f: {
95
95
  };
96
96
  };
97
97
 
98
- declare const config$e: {
98
+ declare const config$f: {
99
99
  ML_ENABLED: boolean;
100
100
  MA_FAST: number;
101
101
  MA_MEDIUM: number;
@@ -194,7 +194,7 @@ declare const config$e: {
194
194
  SL_SHORT: number;
195
195
  };
196
196
 
197
- declare const config$d: {
197
+ declare const config$e: {
198
198
  readonly ENV: "BACKTEST";
199
199
  readonly INTERVAL: Interval;
200
200
  readonly MAKE_ORDERS: true;
@@ -243,7 +243,7 @@ declare const config$d: {
243
243
  };
244
244
  };
245
245
 
246
- declare const config$c: {
246
+ declare const config$d: {
247
247
  readonly ENV: "BACKTEST";
248
248
  readonly INTERVAL: Interval;
249
249
  readonly MAKE_ORDERS: true;
@@ -287,7 +287,9 @@ declare const config$c: {
287
287
  };
288
288
  };
289
289
 
290
- declare const config$b: {
290
+ type GridRangeFilterMode = 'off' | 'block_entries' | 'block_all' | 'edge_all';
291
+
292
+ declare const config$c: {
291
293
  readonly ENV: "BACKTEST";
292
294
  readonly INTERVAL: Interval;
293
295
  readonly MAKE_ORDERS: true;
@@ -333,6 +335,86 @@ declare const config$b: {
333
335
  readonly GRID_ENTRY_COOLDOWN_BARS: 8;
334
336
  readonly GRID_PROTECTION_REPRICE_ATR: 0.15;
335
337
  readonly GRID_MAX_FIGURE_POINTS: 160;
338
+ readonly GRID_RANGE_FILTER_MODE: GridRangeFilterMode;
339
+ readonly GRID_RANGE_PIVOT_LEFT_BARS: 3;
340
+ readonly GRID_RANGE_PIVOT_RIGHT_BARS: 3;
341
+ readonly GRID_RANGE_LOOKBACK_BARS: 96;
342
+ readonly GRID_RANGE_MIN_PIVOTS_PER_SIDE: 2;
343
+ readonly GRID_RANGE_MIN_WIDTH_ATR: 3;
344
+ readonly GRID_RANGE_MAX_WIDTH_ATR: 18;
345
+ readonly GRID_RANGE_MAX_CENTER_SLOPE_ATR_PER_BAR: 0.03;
346
+ readonly GRID_RANGE_MAX_BOUNDARY_DIVERGENCE_ATR: 1;
347
+ readonly GRID_RANGE_MIN_CONTAINMENT_RATIO: 0.75;
348
+ readonly GRID_RANGE_CONTAINMENT_TOLERANCE_ATR: 0.2;
349
+ readonly GRID_RANGE_EDGE_FRACTION: 0.35;
350
+ readonly LONG: {
351
+ readonly enable: true;
352
+ readonly direction: "LONG";
353
+ };
354
+ readonly SHORT: {
355
+ readonly enable: true;
356
+ readonly direction: "SHORT";
357
+ };
358
+ };
359
+
360
+ type GridClassicTakeProfitMode = 'center' | 'opposite_edge';
361
+ type GridClassicEntryConfirmation = 'rejection' | 'close_inside' | 'either';
362
+ declare const config$b: {
363
+ readonly ENV: "BACKTEST";
364
+ readonly INTERVAL: Interval;
365
+ readonly MAKE_ORDERS: true;
366
+ readonly CLOSE_OPPOSITE_POSITIONS: false;
367
+ readonly BACKTEST_PRICE_MODE: "open";
368
+ readonly AI_ENABLED: false;
369
+ readonly AI_MODE: "llm";
370
+ readonly ML_ENABLED: false;
371
+ readonly ML_THRESHOLD: 0.1;
372
+ readonly MIN_AI_QUALITY: 3;
373
+ readonly FEE_PERCENT: 0.001;
374
+ readonly MAX_LOSS_VALUE: 10;
375
+ readonly MA_FAST: 20;
376
+ readonly MA_MEDIUM: 50;
377
+ readonly MA_SLOW: 100;
378
+ readonly OBV_SMA: 10;
379
+ readonly ATR: 14;
380
+ readonly ATR_PCT_SHORT: 7;
381
+ readonly ATR_PCT_LONG: 30;
382
+ readonly BB: 20;
383
+ readonly BB_STD: 2;
384
+ readonly MACD_FAST: 12;
385
+ readonly MACD_SLOW: 26;
386
+ readonly MACD_SIGNAL: 9;
387
+ readonly GRIDCLASSIC_ATR_PERIOD: 14;
388
+ readonly GRIDCLASSIC_PIVOT_LEFT_BARS: 3;
389
+ readonly GRIDCLASSIC_PIVOT_RIGHT_BARS: 3;
390
+ readonly GRIDCLASSIC_LOOKBACK_BARS: 96;
391
+ readonly GRIDCLASSIC_MIN_PIVOTS_PER_SIDE: 3;
392
+ readonly GRIDCLASSIC_MIN_WIDTH_ATR: 3;
393
+ readonly GRIDCLASSIC_MAX_WIDTH_ATR: 14;
394
+ readonly GRIDCLASSIC_MAX_CENTER_SLOPE_ATR_PER_BAR: 0.015;
395
+ readonly GRIDCLASSIC_MAX_BOUNDARY_DIVERGENCE_ATR: 0.8;
396
+ readonly GRIDCLASSIC_MIN_CONTAINMENT_RATIO: 0.9;
397
+ readonly GRIDCLASSIC_CONTAINMENT_TOLERANCE_ATR: 0.2;
398
+ readonly GRIDCLASSIC_BREAKOUT_TOLERANCE_ATR: 0.25;
399
+ readonly GRIDCLASSIC_MIN_RANGE_AGE_BARS: 32;
400
+ readonly GRIDCLASSIC_MAX_VOLATILITY_EXPANSION: 1.8;
401
+ readonly GRIDCLASSIC_MAX_CANDLE_RANGE_ATR: 3;
402
+ readonly GRIDCLASSIC_EDGE_ZONE_FRACTION: 0.12;
403
+ readonly GRIDCLASSIC_ENTRY_CONFIRMATION: GridClassicEntryConfirmation;
404
+ readonly GRIDCLASSIC_MIN_REJECTION_WICK_RATIO: 1.5;
405
+ readonly GRIDCLASSIC_LEVELS: 4;
406
+ readonly GRIDCLASSIC_GRID_STEP_ATR: 0.3;
407
+ readonly GRIDCLASSIC_GRID_STEP_RANGE_FRACTION: 0.1;
408
+ readonly GRIDCLASSIC_LEVEL_SIZE_DECAY: 1;
409
+ readonly GRIDCLASSIC_STOP_ATR_BUFFER: 1.5;
410
+ readonly GRIDCLASSIC_TP_MODE: GridClassicTakeProfitMode;
411
+ readonly GRIDCLASSIC_BREAKOUT_CONFIRM_BARS: 1;
412
+ readonly GRIDCLASSIC_INVALIDATION_BARS: 3;
413
+ readonly GRIDCLASSIC_MAX_HOLD_BARS: 192;
414
+ readonly GRIDCLASSIC_COOLDOWN_BARS: 16;
415
+ readonly GRIDCLASSIC_RISK_SLIPPAGE_BPS: 10;
416
+ readonly GRIDCLASSIC_PROTECTION_REPRICE_ATR: 0.15;
417
+ readonly GRIDCLASSIC_MAX_FIGURE_POINTS: 180;
336
418
  readonly LONG: {
337
419
  readonly enable: true;
338
420
  readonly direction: "LONG";
@@ -877,6 +959,8 @@ declare const doubleTapAiAdapter: StrategyAiAdapter;
877
959
 
878
960
  declare const gridAiAdapter: StrategyAiAdapter;
879
961
 
962
+ declare const gridClassicAiAdapter: StrategyAiAdapter;
963
+
880
964
  declare const liquidityTailsAiAdapter: StrategyAiAdapter;
881
965
 
882
966
  declare const liquidityZonesAiAdapter: StrategyAiAdapter;
@@ -898,4 +982,4 @@ declare const _default: {
898
982
  strategyEntries: StrategyRegistryEntry[];
899
983
  };
900
984
 
901
- export { adaptiveMomentumRibbonAiAdapter, config$g as adaptiveMomentumRibbonDefaultConfig, adaptiveMomentumRibbonMlAdapter, adaptiveTrendChannelAiAdapter, config$f as adaptiveTrendChannelDefaultConfig, config$e as breakoutDefaultConfig, _default as default, doubleTapAiAdapter, config$c as doubleTapDefaultConfig, getBuiltInStrategyDefaultConfig, gridAiAdapter, config$b as gridDefaultConfig, liquidityTailsAiAdapter, config$8 as liquidityTailsDefaultConfig, liquidityZonesAiAdapter, config$7 as liquidityZonesDefaultConfig, maStrategyAiAdapter, config$a as maStrategyDefaultConfig, maStrategyMlAdapter, marketFlushReversalAiAdapter, config$d as marketFlushReversalDefaultConfig, relativeRotationAiAdapter, config$9 as relativeRotationDefaultConfig, reverseTrendLineAiAdapter, config$6 as reverseTrendLineDefaultConfig, strategyEntries, structureZonesAiAdapter, config$5 as structureZonesDefaultConfig, trendFollowAiAdapter, config$4 as trendFollowDefaultConfig, config$2 as trendLineDefaultConfig, trendShiftAiAdapter, config$3 as trendShiftDefaultConfig, volatilityCompressionBreakoutAiAdapter, config as volatilityCompressionBreakoutDefaultConfig, volumeDivergenceAiAdapter, config$1 as volumeDivergenceDefaultConfig, volumeDivergenceMlAdapter };
985
+ export { adaptiveMomentumRibbonAiAdapter, config$h as adaptiveMomentumRibbonDefaultConfig, adaptiveMomentumRibbonMlAdapter, adaptiveTrendChannelAiAdapter, config$g as adaptiveTrendChannelDefaultConfig, config$f as breakoutDefaultConfig, _default as default, doubleTapAiAdapter, config$d as doubleTapDefaultConfig, getBuiltInStrategyDefaultConfig, gridAiAdapter, gridClassicAiAdapter, config$b as gridClassicDefaultConfig, config$c as gridDefaultConfig, liquidityTailsAiAdapter, config$8 as liquidityTailsDefaultConfig, liquidityZonesAiAdapter, config$7 as liquidityZonesDefaultConfig, maStrategyAiAdapter, config$a as maStrategyDefaultConfig, maStrategyMlAdapter, marketFlushReversalAiAdapter, config$e as marketFlushReversalDefaultConfig, relativeRotationAiAdapter, config$9 as relativeRotationDefaultConfig, reverseTrendLineAiAdapter, config$6 as reverseTrendLineDefaultConfig, strategyEntries, structureZonesAiAdapter, config$5 as structureZonesDefaultConfig, trendFollowAiAdapter, config$4 as trendFollowDefaultConfig, config$2 as trendLineDefaultConfig, trendShiftAiAdapter, config$3 as trendShiftDefaultConfig, volatilityCompressionBreakoutAiAdapter, config as volatilityCompressionBreakoutDefaultConfig, volumeDivergenceAiAdapter, config$1 as volumeDivergenceDefaultConfig, volumeDivergenceMlAdapter };