The system jumps in the direction of any bar that closes more than one ATR(10) away from the previous close, long or short. It exits when price closes back through a 5-period SMA or hits a 1% stop, and it trades intraday on index and gold charts.
Best run of 16. S&P 500, 30 min, spread 1, from run sweeps:2026-09-07-USA500-30m-opt.tsv:13.
| Period | Up to 2026-09-07 |
| Instrument | S&P 500, 30 minutes |
| Spread | 1 points |
| Contracts | 1 |
| 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-09-07 |
| positionSize Contracts per trade | 1 |
| atrPeriod ATR length | 10 |
| exitPeriod Exit average length | 5 |
| stopLossPct Protective stop, percent | 1 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| S&P 500Best run | 30 min | n/a | 15,021 | 34.31 | -9,682 EUR | -13,588 |
| Gold | 30 min | n/a | 13,467 | 34.71 | -2,734 EUR | -6,539 |
| Gold | 1 hour | n/a | 8,258 | 33.31 | -3,242 EUR | -5,154 |
| Gold | 5 min | n/a | 13,138 | 29.25 | -7,097 EUR | -7,103 |
| Gold | 15 min | n/a | 12,887 | 28.79 | -7,832 EUR | -7,838 |
| S&P 500 | 1 hour | n/a | 9,180 | 31.60 | -9,240 EUR | -9,466 |
| DAX 40 | 1 hour | n/a | 8,264 | 35.83 | -12,224 EUR | -15,031 |
| S&P 500 | 15 min | n/a | 14,176 | 30.44 | -14,045 EUR | -14,045 |
| S&P 500 | 5 min | n/a | 14,392 | 26.26 | -15,699 EUR | -15,736 |
| Nasdaq 100 | 30 min | n/a | 14,624 | 34.30 | -27,138 EUR | -34,452 |
| Nasdaq 100 | 1 hour | n/a | 9,372 | 30.28 | -28,713 EUR | -28,714 |
| DAX 40 | 30 min | n/a | 13,951 | 34.59 | -31,864 EUR | -42,172 |
| Nasdaq 100 | 15 min | n/a | 13,570 | 33.64 | -32,162 EUR | -32,216 |
| Nasdaq 100 | 5 min | n/a | 13,612 | 31.45 | -36,494 EUR | -36,558 |
| DAX 40 | 5 min | n/a | 14,479 | 29.42 | -45,431 EUR | -45,664 |
| DAX 40 | 15 min | n/a | 13,921 | 31.39 | -47,830 EUR | -47,830 |
Charts
The code
Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.
// ============================================================ // ATR Momentum // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: 30 minutes // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- positionSize = 1 // contracts per trade atrPeriod = 10 // ATR length exitPeriod = 5 // exit average length stopLossPct = 1 // protective stop, percent of entry price // --- Indicators --- atrValue = AverageTrueRange[atrPeriod](close) exitMA = Average[exitPeriod](close)
26 more lines: the entry and exit rules.
Read this first
Questions
The code runs as a ProOrder system with 1 contract and a 1% stop. Given that no tested run was profitable, it makes more sense as a study piece than a live system.
Gold, S&P 500, DAX 40 and Nasdaq 100 on 5, 15, 30 minute and 1 hour charts. All 15 runs ended negative, and Gold lost the least.
On the S&P 500 30 minute chart the maximum drawdown was EUR 13,587.60 trading 1 contract. On DAX 40 15 minutes it reached EUR 47,829.60.
A one-ATR bar on a short chart is a frequent event, which gives thousands of trades to judge the idea. Here the higher trade count mainly made the losses clearer.
Related
Copy trading on US indices is available to ProRealAlgos members as spots open.