A trailing stop line sits 3 ATR(20) from the highest close in an uptrend or the lowest close in a downtrend. The system buys when the close crosses above that line and sells when it crosses below.
Best run of 26. Nasdaq 100, Daily, spread 3, from run pf:2026-10-12-NAS100-D.tsv:6.
| Period | Up to 2026-10-12 |
| Instrument | Nasdaq 100, Daily |
| Spread | 3 points |
| Starting capital | 1,000,000 |
| Costs | Spread only. Commissions and overnight financing are not included. |
| Bars | Up to 200,000 bars, fewer where the instrument has less history |
| Last tested | 2026-10-12 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| Nasdaq 100Best run | Daily | 2.09 | 203 | 46.31 | 20,005 EUR | -4,427 |
| USD/JPY | Daily | n/a | 227 | 40.53 | 724,280 USD | -555,110 |
| USD/JPY | 30 min | n/a | 2,972 | 37.72 | 474,500 USD | -192,960 |
| USD/JPY | 1 hour | n/a | 2,056 | 38.96 | 412,490 USD | -284,760 |
| Silver | 4 hours | n/a | 457 | 37.86 | 33,473 USD | -13,159 |
| Nikkei 225 | 4 hours | n/a | 418 | 41.87 | 27,324 USD | -14,460 |
| Dow Jones | Daily | n/a | 215 | 42.79 | 25,184 EUR | -8,885 |
| Nikkei 225 | Daily | n/a | 233 | 39.91 | 24,821 USD | -15,707 |
| Nikkei 225 | 1 hour | n/a | 1,652 | 38.14 | 16,189 USD | -10,262 |
| DAX 40 | 30 min | n/a | 3,410 | 37.24 | 12,693 EUR | -3,569 |
| Nasdaq 100 | 1 hour | n/a | 2,191 | 38.61 | 11,621 EUR | -3,968 |
| Nasdaq 100 | 4 hours | n/a | 565 | 40.88 | 10,455 EUR | -6,322 |
| Nasdaq 100 | 15 min | n/a | 3,375 | 37.72 | 9,957 EUR | -4,905 |
| DAX 40 | 1 hour | n/a | 1,905 | 39.42 | 9,893 EUR | -3,931 |
| Dow Jones | 4 hours | n/a | 182 | 38.46 | 9,510 EUR | -6,746 |
| Nasdaq 100 | 30 min | n/a | 3,567 | 38.13 | 9,245 EUR | -4,108 |
| Nasdaq 100 | 10 min | n/a | 3,324 | 38.00 | 9,032 EUR | -6,440 |
| Nasdaq 100 | 5 min | n/a | 3,148 | 37.36 | 6,855 EUR | -3,593 |
| DAX 40 | 4 hours | n/a | 526 | 41.25 | 5,861 EUR | -3,564 |
| Gold | 4 hours | n/a | 482 | 42.32 | 3,227 EUR | -1,063 |
| S&P 500 | Daily | n/a | 262 | 40.84 | 2,918 EUR | -1,030 |
| Gold | 30 min | n/a | 3,069 | 37.21 | 2,553 EUR | -746 |
| Gold | Daily | n/a | 233 | 41.63 | 2,483 EUR | -1,325 |
| S&P 500 | 4 hours | n/a | 553 | 42.13 | 2,474 EUR | -1,094 |
| Gold | 1 hour | n/a | 1,814 | 39.14 | 2,390 EUR | -814 |
| S&P 500 | 30 min | n/a | 3,492 | 37.89 | 1,322 EUR | -1,141 |
Charts
Top 10 of 26 runs. The full list is in the table above.
The code
// ============================================================== // ATR Trailing Stop Crossover // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long only // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false ONCE init = 0 ONCE vmax = 0 ONCE vmin = 0 ONCE uptrend = 1 ONCE vstop = 0
45 more lines: the entry and exit rules.
Setup
Questions
Yes. The code is ProBuilder and runs as an automated ProOrder system. Backtest it on your own account with your own spread and position size before trading it live.
It was tested on 26 market and timeframe combinations. The best run was Nasdaq 100, Daily, with a profit factor of 2.09 over 203 trades.
The best run had a maximum drawdown of 4,427 EUR at the tested position size, against a net result of 20,005 EUR.
It only takes long trades.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.