@tradejs/strategy-head-and-shoulders 3.0.5 → 3.0.6-beta.15

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.cjs CHANGED
@@ -44,7 +44,9 @@ var config = {
44
44
  ML_ENABLED: false,
45
45
  ML_THRESHOLD: 0.1,
46
46
  MIN_AI_QUALITY: 4,
47
- FEE_PERCENT: import_constants.FEE_PERCENT,
47
+ RISK_FEE_RATE: import_constants.FEE_PERCENT,
48
+ RISK_SLIPPAGE_BPS: 0,
49
+ RISK_MARKET_IMPACT_BPS: 0,
48
50
  MAX_LOSS_VALUE: 10,
49
51
  MA_FAST: 14,
50
52
  MA_MEDIUM: 49,
@@ -930,8 +932,8 @@ var createHeadAndShouldersCore = async ({ config: config2, data: initialData, st
930
932
  entryPrice: currentPrice,
931
933
  stopLossPrice: pattern.stopLossPrice,
932
934
  takeProfitPrice: pattern.targetPrice,
933
- feeRate: Number(config2.FEE_PERCENT ?? 0),
934
- slippageBps: Number(config2.SLIPPAGE_BASE_BPS ?? 0) + Number(config2.SLIPPAGE_MARKET_IMPACT_BPS ?? 0)
935
+ feeRate: Number(config2.RISK_FEE_RATE ?? 0),
936
+ slippageBps: Number(config2.RISK_SLIPPAGE_BPS ?? 0) + Number(config2.RISK_MARKET_IMPACT_BPS ?? 0)
935
937
  });
936
938
  const qty = economics.lossPerUnit > 0 ? Number(config2.MAX_LOSS_VALUE ?? 0) / economics.lossPerUnit : 0;
937
939
  const riskRatio = economics.netRiskRatio;
@@ -1061,7 +1063,7 @@ var headAndShouldersManifest = {
1061
1063
  // src/HeadAndShoulders/strategy.ts
1062
1064
  var HeadAndShouldersStrategyDefinition = {
1063
1065
  defaults: config,
1064
- parseConfig: (0, import_config3.createStrategyConfigParser)({
1066
+ parseConfig: (0, import_config3.createCostIsolatedStrategyConfigParser)({
1065
1067
  strategyName: "HeadAndShoulders",
1066
1068
  defaults: config
1067
1069
  }),
package/dist/index.d.cts CHANGED
@@ -18,7 +18,9 @@ declare const config: {
18
18
  readonly ML_ENABLED: false;
19
19
  readonly ML_THRESHOLD: 0.1;
20
20
  readonly MIN_AI_QUALITY: 4;
21
- readonly FEE_PERCENT: 0.001;
21
+ readonly RISK_FEE_RATE: 0.001;
22
+ readonly RISK_SLIPPAGE_BPS: 0;
23
+ readonly RISK_MARKET_IMPACT_BPS: 0;
22
24
  readonly MAX_LOSS_VALUE: 10;
23
25
  readonly MA_FAST: 14;
24
26
  readonly MA_MEDIUM: 49;
package/dist/index.d.ts CHANGED
@@ -18,7 +18,9 @@ declare const config: {
18
18
  readonly ML_ENABLED: false;
19
19
  readonly ML_THRESHOLD: 0.1;
20
20
  readonly MIN_AI_QUALITY: 4;
21
- readonly FEE_PERCENT: 0.001;
21
+ readonly RISK_FEE_RATE: 0.001;
22
+ readonly RISK_SLIPPAGE_BPS: 0;
23
+ readonly RISK_MARKET_IMPACT_BPS: 0;
22
24
  readonly MAX_LOSS_VALUE: 10;
23
25
  readonly MA_FAST: 14;
24
26
  readonly MA_MEDIUM: 49;
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { defineStrategyPlugin } from "@tradejs/core/config";
3
3
 
4
4
  // src/HeadAndShoulders/config.ts
5
- import { FEE_PERCENT } from "@tradejs/core/constants";
5
+ import { FEE_PERCENT as RISK_FEE_RATE } from "@tradejs/core/constants";
6
6
  var config = {
7
7
  ENV: "BACKTEST",
8
8
  INTERVAL: "15",
@@ -14,7 +14,9 @@ var config = {
14
14
  ML_ENABLED: false,
15
15
  ML_THRESHOLD: 0.1,
16
16
  MIN_AI_QUALITY: 4,
17
- FEE_PERCENT,
17
+ RISK_FEE_RATE,
18
+ RISK_SLIPPAGE_BPS: 0,
19
+ RISK_MARKET_IMPACT_BPS: 0,
18
20
  MAX_LOSS_VALUE: 10,
19
21
  MA_FAST: 14,
20
22
  MA_MEDIUM: 49,
@@ -78,7 +80,7 @@ var config = {
78
80
  };
79
81
 
80
82
  // src/HeadAndShoulders/strategy.ts
81
- import { createStrategyConfigParser } from "@tradejs/strategy-kit/config";
83
+ import { createCostIsolatedStrategyConfigParser } from "@tradejs/strategy-kit/config";
82
84
 
83
85
  // src/HeadAndShoulders/core.ts
84
86
  import { round } from "@tradejs/core/math";
@@ -903,8 +905,8 @@ var createHeadAndShouldersCore = async ({ config: config2, data: initialData, st
903
905
  entryPrice: currentPrice,
904
906
  stopLossPrice: pattern.stopLossPrice,
905
907
  takeProfitPrice: pattern.targetPrice,
906
- feeRate: Number(config2.FEE_PERCENT ?? 0),
907
- slippageBps: Number(config2.SLIPPAGE_BASE_BPS ?? 0) + Number(config2.SLIPPAGE_MARKET_IMPACT_BPS ?? 0)
908
+ feeRate: Number(config2.RISK_FEE_RATE ?? 0),
909
+ slippageBps: Number(config2.RISK_SLIPPAGE_BPS ?? 0) + Number(config2.RISK_MARKET_IMPACT_BPS ?? 0)
908
910
  });
909
911
  const qty = economics.lossPerUnit > 0 ? Number(config2.MAX_LOSS_VALUE ?? 0) / economics.lossPerUnit : 0;
910
912
  const riskRatio = economics.netRiskRatio;
@@ -1037,7 +1039,7 @@ var headAndShouldersManifest = {
1037
1039
  // src/HeadAndShoulders/strategy.ts
1038
1040
  var HeadAndShouldersStrategyDefinition = {
1039
1041
  defaults: config,
1040
- parseConfig: createStrategyConfigParser({
1042
+ parseConfig: createCostIsolatedStrategyConfigParser({
1041
1043
  strategyName: "HeadAndShoulders",
1042
1044
  defaults: config
1043
1045
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tradejs/strategy-head-and-shoulders",
3
- "version": "3.0.5",
3
+ "version": "3.0.6-beta.15",
4
4
  "description": "Head-and-shoulders and inverse-pattern strategy with neckline confirmation, retests, and pattern-height risk targets for TradeJS.",
5
5
  "type": "module",
6
6
  "packageManager": "yarn@4.13.0",
@@ -46,7 +46,7 @@
46
46
  "sideEffects": false,
47
47
  "devDependencies": {
48
48
  "@tradejs/core": "^3.0.1",
49
- "@tradejs/strategy-kit": "^3.0.1",
49
+ "@tradejs/strategy-kit": "^3.0.5",
50
50
  "@tradejs/types": "^3.0.1",
51
51
  "@types/jest": "^29.5.14",
52
52
  "jest": "^29.7.0",
@@ -70,7 +70,7 @@
70
70
  "author": "aleksnick (https://github.com/aleksnick)",
71
71
  "peerDependencies": {
72
72
  "@tradejs/core": "^3.0.1",
73
- "@tradejs/strategy-kit": "^3.0.1",
73
+ "@tradejs/strategy-kit": "^3.0.5",
74
74
  "@tradejs/types": "^3.0.1"
75
75
  }
76
76
  }