Auto Trailing stoploss By InvestYourAsset
Oct 15, 2023

The Auto Trailing SL By InvestYourAsset indicator provides a dynamic volatility-based trailing stop-loss mechanism designed to help traders secure profits and identify optimal exit points for both long and short positions.
Usage
The Usage section focuses on how the indicator assists in trend following and risk management. By utilizing market volatility, the tool plots two distinct lines on the chart: a Short Stop (typically red) and a Long Stop (typically green).
Traders can use the indicator in the following ways:
- Long Entries: A long signal is generated when the price crosses above both the short stop and the long stop levels. This indicates a potential bullish trend shift.
- Short Entries: A short signal is generated when the price crosses below both stop levels, indicating a potential bearish trend shift.
- Exit Strategy: For an active long position, the green Long Stop line acts as the trailing exit level. If the price closes below this line, a "Long Stoploss Hit" signal is triggered, suggesting an exit to protect capital. Conversely, for short positions, a cross above the red Short Stop line suggests an exit.
- Profit Protection: As the price moves in a favorable direction, the stop-loss lines move accordingly. This allows traders to lock in gains automatically without manual adjustment.
Details
The script is constructed using the Average True Range (ATR) to measure market volatility. The core logic involves a two-step calculation process:
- Initial Stop Calculation: The script determines an initial high and low stop level by taking the highest high or lowest low over a specific lookback period and applying a multiplier to the current ATR value. This ensures the stop distance is proportional to current market fluctuations.
- Trailing Logic: To create the trailing effect, the script uses a "Stop Period" to track the highest value of the initial high stop (for shorts) and the lowest value of the initial low stop (for longs). This prevents the stop-loss from widening against the trader's position, ensuring it only moves in a direction that secures profit or reduces risk.
The indicator also includes visual shapes and background highlights to signal when specific stop-loss levels are breached or when new trend signals are confirmed.
Settings
- ATR Period: Defines the lookback length used to calculate the Average True Range. A higher value results in a smoother, less reactive volatility measurement.
- Stop Period: Determines the lookback period for the trailing mechanism. This setting affects how long the stop level remains at its peak or trough before adjusting.
- Multiplier: Sets the distance of the stop-loss from the price action. Increasing the multiplier provides more "breathing room" for the trade but results in a wider stop-loss.
FAQ
How do I interpret the colored shapes on the chart? The upward-pointing triangles represent a Short Stoploss Hit (potential bullish reversal), while the downward-pointing triangles represent a Long Stoploss Hit (potential bearish reversal).
Can this indicator be used for swing trading? Yes, by increasing the ATR Period and Multiplier, traders can adapt the indicator for longer-term swing trading to avoid being stopped out by minor intraday price fluctuations.
How do I access the Auto Trailing SL By InvestYourAsset? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.