The strategy buys when the 9-bar average crosses above the 21-bar average with price above the 200-bar average, and sells short on the mirror crossover below it. Each signal sets a stop 2 times ATR(14) away and a target at double that distance.
Best run of 12. USD/JPY, Daily, spread 1, from run pf:2026-10-12-USDJPY-D.tsv:6.
| Period | Up to 2026-10-12 |
| Instrument | USD/JPY, Daily |
| Spread | 1 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 |
|---|---|---|---|---|---|---|
| USD/JPYBest run | Daily | 1.58 | 340 | 40.88 | 24,340 USD | -2,300 |
| US Crude Oil | 4 hours | 1.23 | 503 | 37.57 | 10,385 EUR | -2,549 |
| Dow Jones | Daily | n/a | 297 | 36.03 | 9,593 EUR | -5,268 |
| Brent Crude | 4 hours | n/a | 381 | 38.32 | 8,806 EUR | -4,036 |
| Nasdaq 100 | Daily | n/a | 236 | 36.02 | 7,962 EUR | -6,313 |
| Dow Jones | 4 hours | n/a | 232 | 37.50 | 6,549 EUR | -6,508 |
| DAX 40 | Daily | n/a | 329 | 37.39 | 5,973 EUR | -5,757 |
| Nasdaq 100 | 4 hours | n/a | 712 | 33.43 | 4,049 EUR | -3,244 |
| S&P 500 | Daily | n/a | 333 | 35.14 | 2,382 EUR | -789 |
| Gold | 1 hour | n/a | 2,673 | 33.41 | 1,518 EUR | -1,187 |
| Gold | Daily | n/a | 297 | 41.41 | 1,438 EUR | -828 |
| S&P 500 | 4 hours | n/a | 688 | 33.58 | 1,194 EUR | -774 |
Charts
Top 10 of 12 runs. The full list is in the table above.
Above 1.0 made money, below 1.0 lost money.
The code
// ============================================================== // SMA Crossover ATR Bracket Trend Filter // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long & short // Timeframe tested: Daily // ============================================================== DEFPARAM CumulateOrders = false fast = Average[9](close) slow = Average[21](close) trend = Average[200](close) myAtr = AverageTrueRange[14](close) sl = myAtr * 2 tp = myAtr * 2 * 2
26 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 12 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.58 over 340 trades.
The best run had a maximum drawdown of 2,300 USD at the tested position size, against a net result of 24,340 USD.
It trades both long and short.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.