Auto Trailing stoploss By InvestYourAsset

Oct 15, 2023

Static chart image
Dynamic Overlays
Signals
Trailing-Stop
Volatility

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:

  1. 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.
  2. 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 access on the following platforms
tradingviewSymbolTradingView
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

ninjatraderNinjaTrader
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

metatrader4MetaTrader 4/5
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

thinkorswimThinkorswim
Open in your browser

This in-app browser is not compatible with Get Access from the library.

Tap the menu (...) at the top of your screen and select "Open in Browser", "Open in Safari", or "Open in Chrome" to continue.

Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.

Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.

Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.

As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.

Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.

Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.

This does not represent our full Disclaimer. Please read our full disclaimer.

© 2026 LuxAlgo Global, LLC.