@tradejs/strategy-trend-follow 3.0.0 → 3.0.1

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/README.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  TradeJS strategy plugin providing `TrendFollow`.
4
4
 
5
+ ## Strategy overview
6
+
7
+ `TrendFollow` maintains an ATR-offset trailing trend state from replayable
8
+ pivot structure. It trades directional flips with optional structure-breakout,
9
+ trend, benchmark, volume, persistence, RSI, and volatility filters, and can
10
+ exit on the trailing stop or an opposite signal.
11
+
12
+ ## Logic at a glance
13
+
14
+ ![TrendFollow strategy logic](https://raw.githubusercontent.com/TradeJS-Dev/TradeJS-Strategy-TrendFollow/main/docs/strategy-logic.svg)
15
+
5
16
  ## Install
6
17
 
7
18
  ```bash
@@ -30,5 +41,10 @@ yarn install --immutable
30
41
  yarn checks
31
42
  ```
32
43
 
33
- Publishing is triggered by a GitHub release and delegated to the pinned
34
- `TradeJS-Workflows@v1` reusable workflow.
44
+ Publishing is beta-first and delegated to the pinned
45
+ `TradeJS-Workflows@v1` reusable workflow. A relevant push publishes a unique
46
+ prerelease and moves the npm `beta` tag only after the production-like Project
47
+ image passes. The current verified beta is promoted to one stable `latest`
48
+ release by the weekly automation; production never consumes prereleases.
49
+
50
+ Keywords: ai, claude, codex.
package/dist/index.cjs CHANGED
@@ -1251,7 +1251,7 @@ Interpretation rules for TrendFollow:
1251
1251
  var trendFollowAiAdapter = (0, import_ai_gate.withStrategyLocalAiGate)(
1252
1252
  trendFollowBaseAiAdapter,
1253
1253
  {
1254
- id: "trend_follow_short_breadth_2026_08_12",
1254
+ id: "trend_follow_short_breadth_loss_guard_2026_08_18",
1255
1255
  approves: ({ signal, payload }) => {
1256
1256
  const advancers = (0, import_ai_gate.getAiPayloadNumber)(
1257
1257
  payload,
@@ -1261,7 +1261,20 @@ var trendFollowAiAdapter = (0, import_ai_gate.withStrategyLocalAiGate)(
1261
1261
  payload,
1262
1262
  "additionalIndicators.baseContext.relative.marketBreadths.top5.unchanged"
1263
1263
  );
1264
- return signal.direction === "SHORT" && advancers != null && advancers >= 2 && top5Unchanged != null && top5Unchanged <= 0;
1264
+ const ethM15LevelsCrossed = (0, import_ai_gate.getAiPayloadNumber)(
1265
+ payload,
1266
+ "additionalIndicators.baseContext.relative.referencePsychologicalLevels.ETHUSDT.windows.m15.levelsCrossed"
1267
+ );
1268
+ const distanceToStopPct = (0, import_ai_gate.getAiPayloadNumber)(
1269
+ payload,
1270
+ "additionalIndicators.trendFollowContext.distanceToStopPct"
1271
+ );
1272
+ const top5EqualWeightedReturn = (0, import_ai_gate.getAiPayloadNumber)(
1273
+ payload,
1274
+ "additionalIndicators.baseContext.relative.marketBreadths.top5.equalWeightedReturn"
1275
+ );
1276
+ const avoidsDiscoveredLossPocket = ethM15LevelsCrossed != null && ethM15LevelsCrossed > 1 || distanceToStopPct != null && distanceToStopPct < 5.6151907 || top5EqualWeightedReturn != null && top5EqualWeightedReturn > -0.0023580731;
1277
+ return signal.direction === "SHORT" && advancers != null && advancers >= 2 && top5Unchanged != null && top5Unchanged <= 0 && avoidsDiscoveredLossPocket;
1265
1278
  }
1266
1279
  }
1267
1280
  );
package/dist/index.js CHANGED
@@ -1227,7 +1227,7 @@ Interpretation rules for TrendFollow:
1227
1227
  var trendFollowAiAdapter = withStrategyLocalAiGate(
1228
1228
  trendFollowBaseAiAdapter,
1229
1229
  {
1230
- id: "trend_follow_short_breadth_2026_08_12",
1230
+ id: "trend_follow_short_breadth_loss_guard_2026_08_18",
1231
1231
  approves: ({ signal, payload }) => {
1232
1232
  const advancers = getAiPayloadNumber(
1233
1233
  payload,
@@ -1237,7 +1237,20 @@ var trendFollowAiAdapter = withStrategyLocalAiGate(
1237
1237
  payload,
1238
1238
  "additionalIndicators.baseContext.relative.marketBreadths.top5.unchanged"
1239
1239
  );
1240
- return signal.direction === "SHORT" && advancers != null && advancers >= 2 && top5Unchanged != null && top5Unchanged <= 0;
1240
+ const ethM15LevelsCrossed = getAiPayloadNumber(
1241
+ payload,
1242
+ "additionalIndicators.baseContext.relative.referencePsychologicalLevels.ETHUSDT.windows.m15.levelsCrossed"
1243
+ );
1244
+ const distanceToStopPct = getAiPayloadNumber(
1245
+ payload,
1246
+ "additionalIndicators.trendFollowContext.distanceToStopPct"
1247
+ );
1248
+ const top5EqualWeightedReturn = getAiPayloadNumber(
1249
+ payload,
1250
+ "additionalIndicators.baseContext.relative.marketBreadths.top5.equalWeightedReturn"
1251
+ );
1252
+ const avoidsDiscoveredLossPocket = ethM15LevelsCrossed != null && ethM15LevelsCrossed > 1 || distanceToStopPct != null && distanceToStopPct < 5.6151907 || top5EqualWeightedReturn != null && top5EqualWeightedReturn > -0.0023580731;
1253
+ return signal.direction === "SHORT" && advancers != null && advancers >= 2 && top5Unchanged != null && top5Unchanged <= 0 && avoidsDiscoveredLossPocket;
1241
1254
  }
1242
1255
  }
1243
1256
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tradejs/strategy-trend-follow",
3
- "version": "3.0.0",
4
- "description": "TrendFollow strategy plugin for TradeJS.",
3
+ "version": "3.0.1",
4
+ "description": "ATR trailing-trend strategy using pivot structure, optional breakout and benchmark filters, and trail or opposite-signal exits for TradeJS.",
5
5
  "type": "module",
6
6
  "packageManager": "yarn@4.13.0",
7
7
  "engines": {
@@ -12,7 +12,10 @@
12
12
  "trading",
13
13
  "strategy",
14
14
  "plugin",
15
- "backtesting"
15
+ "backtesting",
16
+ "ai",
17
+ "claude",
18
+ "codex"
16
19
  ],
17
20
  "homepage": "https://tradejs.dev",
18
21
  "repository": {