PROTECTED SOURCE SCRIPT

Market Trend status

30
BullTrading Free Indicator Series

What is the Trend State Machine?

A “trend state machine” that fuses DMI (+DI/−DI) with ADX strength. It avoids bells and whistles and answers three things with minimal rules:
1. Whether the market is range-bound (chop) or trending;
2. If trending, whether it is bullish (long) or bearish (short);
3. The trend intensity tier (Strong / Extreme / Decaying) plus a 0–100 strength score.

1-Minute Quick Start (beginners can stop here)
1. Timeframe – pick your trading anchor first
• Crypto: 5–15m
• Gold: 5m or 15m
• FX: 15–30m
2. Mode – top of the panel: set Mode = Simple.
3. Sensitivity – set Sensitivity (1 conservative – 5 aggressive). Recommended:
• Crypto: 3 (use 4 in high volatility)
• Gold: 2–3
• FX: 2–3
• Indices: 2
4. Read the card (top-right)
• Environment: Range/Invalid, Bull Trend (Watch), Bull Trend (Confirmed) (bearish equivalents apply)
• Add-ons: | Strong, | Extreme, | Decay
• Also shows ADX, Enter/Exit thresholds, ΔDI, and Score.
5. Background & lines
• Green/Red background = in trend; deeper shade = stronger.
• Orange thick line = ADX, Green = +DI, Red = −DI; shaded band between lines is the enter/exit zone.
6. Minimal execution rules
• Trade with the trend only: consider entries only when Environment = Confirmed and direction is bull/bear.
• Prioritize strength: when Strong Trend triggers or Score > 70, prefer trend-following adds / enable trailing take-profit.
• Exit: when Exit/Flip alert fires, or after Decay if ADX falls back below the enter threshold, reduce/close.

Note: In Simple mode, built-in hysteresis (Enter > Exit) cuts whipsaws significantly—no need to hand-tune thresholds.

How to Use Alerts
• Three built-in fixed alerts:
1. Trend Confirmed (Bull/Bear) — entry/add trigger
2. Strong Trend — momentum reinforcement (chase/add or tighten trailing TP)
3. Exit or Flip — scale-out/close/observe the other side
• Want dynamic messages with numbers? Check “Enable dynamic alerts (alert())” and, when creating the alert, choose Any alert() function call.

Parameter Guidance (rules of thumb)
• Sensitivity: Higher = earlier entries but more false signals; lower = later confirmation but steadier.
• Timeframe: The smaller the timeframe, the lower the sensitivity you usually need; on higher timeframes you may nudge it up.
• Combos:
• Crypto: 5m/15m + Sens 3 (4 in heavy vol)
• Gold: 5m/15m + Sens 2–3
• FX: 15m/30m + Sens 2–3
• Indices: 15m/30m + Sens 2

Pro Mode Highlights (optional)
• Threshold Mode: switch from Fixed (default) to Percentile Adaptive for better robustness across regimes/markets.
• ΔDI / Slope / Hold / Cool-down:
• ΔDI min separation filters weak price/volume divergences.
• ADX slope > threshold on entry rejects “breakouts without growing strength”.
• Min hold bars confirms before output to reduce whipsaws.
• Cool-down bars prevent immediate re-entry after exit/flip.
• MTF Aggregation: enable MTF, default 3× current timeframe, HTF weight 0.3–0.5.
• Turn on Require HTF not opposite & HTF_ADX ≥ exit threshold to effectively filter higher-TF noise.

Reading Cheat Sheet (what you see = what it means)
• Environment: Range/Invalid → Stand down; avoid counter-trend.
• Trend (Watch) → Just entered the zone; wait for Confirmed or buy the pullback with small size.
• Trend (Confirmed) → Trend-following allowed; use Score and Strong/Decay to size/manage.
• Strong Trend → Consider chasing/relaxing TP; momentum is increasing.
• Extreme → Overheated; be cautious chasing—favor trailing to lock gains.
• Decay → Momentum bending down; prepare to trim or tighten stops.

Common Pitfalls & Fixes
• Whipsaws in ranges → Lower sensitivity or move up a timeframe; in Pro mode, enable Slope filter.
• Confirmation too late → During Trend (Watch), try a probe with smaller size; add on confirmation.
• Cross-asset differences → Use Percentile thresholds and MTF weight, or adjust via market presets (Gold/FX/Index).
• Single-signal bias → Always combine Environment + Score + Strong/Decay to avoid tunnel vision.



Disclaimer: This tool is for educational and research purposes only and does not constitute investment advice or a promise of profit. Trading involves risk; you are solely responsible for your gains and losses.

BullTrading免费指标系列

趋势状态机 是什么:
一个把 DMI(+DI/-DI) 与 ADX 强度合成的“趋势状态机”。它不追求花哨,而是用最小规则输出三件事:
1. 市场当前是 震荡还是趋势;
2. 如是趋势,是 多还是 空;
3. 趋势的 强弱等级(强趋势/极端/衰减)与一个 0–100 的强度分数。

一分钟上手(新手用这个就够)
1. 时间周期:先选你交易的主周期(例:加密 5–15m;黄金 5m 或 15m;外汇 15–30m)。
2. 模式:面板最上方“模式”= 简单。
3. 敏感度:设“敏感度(1保守–5激进)”。推荐:
• Crypto:3(波动大可 4)
• Gold:2–3
• FX:2–3
• 指数/股指:2
4. 读卡片(右上角)
• 环境:震荡/无效、多头趋势(观察)、多头趋势(已确认)(空头同理)
• 附加:|强趋势、|极端、|衰减
• 同时显示 ADX、进入/退出阈值、ΔDI、评分。
5. 底色 & 线
• 绿色/红色底色=处于趋势;颜色越实=越强。
• 橙色粗线=ADX,绿色=+DI,红色=-DI;中间阴影为进入/退出带。
6. 最小执行规则
• 只顺势:环境=已确认 且方向为多/空时才考虑进场。
• 强势优先:出现 强趋势 或评分>70 时,优先做顺势加仓/启动追踪止盈。
• 退出:出现 退出/翻转 告警,或 衰减 后 ADX 再跌回进入阈值下方时,减仓/平仓。

提醒:简单模式下,脚本已内置迟滞(进入>退出),可显著减少抖动;无需再手动校准阈值。

告警怎么用
• 已内置三条固定告警:
1. 趋势已确认(多/空) — 入场/加仓触发器
2. 强趋势 — 趋势强化(可做追击或加速移动止盈)
3. 退出或翻转 — 减仓/止盈/反向观察
• 想带数值的动态文案:勾选“启用动态告警 alert()”,创建告警时选择 Any alert() function call。

参数建议(简易法则)
• 敏感度:更激进(数字大)=更早进场但更易假信号;更保守(数字小)=更迟确认但更稳。
• 时间周期:越小周期越需要降低敏感度;越大周期可略升敏感度。
• 组合:
• Crypto:5m/15m + 敏感度 3(波动大时 4)
• Gold:5m/15m + 敏感度 2–3
• FX:15m/30m + 敏感度 2–3
• 指数:15m/30m + 敏感度 2

专业模式要点(进阶可选)
• 阈值模式:从“固定阈值(默认)”切到“百分位自适应”,在大波动/换市场时更鲁棒。
• ΔDI/斜率/驻留/冷却:
• ΔDI 最小分离度 过滤弱量价背离;
• 进入需 ADX 斜率>阈值 可拒绝“强度不增”的假突破;
• 最小驻留K数 确认后再输出,减少回撤抖动;
• 冷却K数 防止来回打脸。
• MTF 聚合:勾选“启用 MTF”,默认自动 3× 当前周期,HTF 权重 0.3–0.5。
• 要求HTF不反向且HTF_ADX≥退出阈值 打开,能有效剔除逆大级别噪音。

读图速查(你看到=代表什么)
• 环境:震荡/无效 → 暂停;不要逆势开单。
• 趋势(观察) → 刚进入阈值,等待 已确认 或回踩二次确认。
• 趋势(已确认) → 允许顺势;用评分和“强趋势/衰减”微调仓位。
• 强趋势 → 追击或放宽止盈,趋势动能在增强。
• 极端 → 过热区;谨慎追高,更多用移动止盈锁定。
• 衰减 → 动能下弯,准备减仓或收紧止盈。

常见坑 & 对策
• 在震荡箱体频繁进出:降低敏感度或升周期;专业模式勾选“斜率过滤”。
• 确认太慢错过起点:在确认前的“趋势(观察)”阶段,可用更小仓位的试探单,确认后加仓。
• 不同品种差异大:用“百分位”阈值与 MTF 权重;或按市场预设(Gold/FX/Index)微调。
• 只看一个信号:至少同时看 环境状态 + 评分 + 强/衰 三个维度,避免单指标偏差。


本指标仅供教育与研究,不构成投资建议或收益承诺;交易有风险,盈亏自负。









Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.