OPEN-SOURCE SCRIPT
Updated

ATR Trailing Stops Strategy

Update of Average True Range Trailing Stops Strategy by HPotter to include backtesting support

  • Opens longs when price crosses over trailing stop line, closes when price crosses below
  • Option to open/close shorts when longs are closed/opened
  • Option to specify a time range to test over. For example, set Max Days Back to 360 and Min Days Back to 180 to test from 1 year ago to 6 months ago. To test the entire range of data, set both to 0.
Release Notes
Fixed long/short switching

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.