已更新

Dynamic Candle Trailing Stop

569
Dynamic Candle Trailing Stop (v1)

The Dynamic Candle Trailing Stop is a clean, multi-directional trailing stop tool designed to help traders automate exit management, protect profits, and reduce emotional decision-making.

Instead of relying on volatility indicators like ATR or static percentages, this indicator anchors its trailing stop directly to recent price structure (highs and lows over a customizable candle period, default is 6 candles).

-----

🔹 How It Works

1. Structural Anchoring: It continuously calculates the highest high and lowest low over a user-defined lookback window (`# of Candles to Look Back`).
2. One-Way Ratcheting Mechanism:
- In a Long Trend: The trailing stop only moves UP (ratchets upward as new local lows form) and will never step down.
- In a Short Trend: The trailing stop only moves DOWN (ratchets downward as new local highs form) and will never step up.
3. Automated Trend Reset: When price closes beyond the trailing stop, the trend state automatically flips, and the stop resets to the opposite structural boundary.

-----

🟢 How to Use It

* Color Coding:
* Green Stepline: Active Long Trailing Stop.
* Red Stepline: Active Short Trailing Stop.
* Exit Signal: Close a position when the candle closes beyond the stepline.
* Trend Filtering: Use the line color as an extra confirmation filter for current short-term directional bias.
* Ranges: Don't ratchet your stop if the current candles closes opposite direction. Leave space for a range to breath. If you move the stop too aggressively you won't be able to capture the bigger move.

-----

⚙️ Settings

* # of Candles to Look Back:
* Default: `6`
* Lower values (e.g., 2–3) provide a tight, fast-reacting trail for scalping.
* Higher values (e.g., 5–10) give the asset more breathing room, suited for longer intraday trading.

-----

Open source under Mozilla Public License 2.0. Enjoy, and safe trading!
版本注释
Changed default # of candles to 6 as I've found that to be a better starting point.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。