The idea compares a 241-bar average of closing prices with a 241-bar average of opening prices. It buys when the close average moves to or above the open average and sells when it moves back below.
Best run of 27. USD/JPY, 30 min, spread 1, from run sweeps:2026-10-12-USDJPY-30m-opt.tsv:13.
| Period | Up to 2026-10-12 |
| Instrument | USD/JPY, 30 minutes |
| 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 | 30 min | n/a | 2,659 | 28.02 | 352,070 USD | -219,690 |
| USD/JPY | 1 hour | n/a | 1,880 | 29.52 | 409,000 USD | -361,600 |
| USD/JPY | 10 min | n/a | 2,618 | 28.76 | 255,530 USD | -185,050 |
| EUR/USD | 4 hours | n/a | 566 | 32.69 | 52,729 USD | -32,880 |
| Nikkei 225 | Daily | n/a | 140 | 32.14 | 47,755 USD | -16,333 |
| Nasdaq 100 | Daily | n/a | 97 | 40.21 | 29,004 EUR | -4,670 |
| Dow Jones | Daily | n/a | 155 | 34.84 | 28,969 EUR | -11,805 |
| DAX 40 | Daily | n/a | 113 | 36.28 | 19,709 EUR | -5,047 |
| Nikkei 225 | 4 hours | n/a | 396 | 28.54 | 17,403 USD | -12,336 |
| Nikkei 225 | 30 min | n/a | 2,642 | 24.45 | 17,307 USD | -10,898 |
| Nasdaq 100 | 4 hours | n/a | 356 | 27.81 | 15,437 EUR | -4,882 |
| Nasdaq 100 | 1 hour | n/a | 1,426 | 26.65 | 13,820 EUR | -4,358 |
| Nasdaq 100 | 30 min | n/a | 1,962 | 25.79 | 13,605 EUR | -4,327 |
| Dow Jones | 1 hour | n/a | 525 | 34.67 | 11,890 EUR | -7,274 |
| Nikkei 225 | 1 hour | n/a | 1,369 | 27.76 | 11,613 USD | -9,142 |
| Dow Jones | 30 min | n/a | 988 | 30.97 | 11,071 EUR | -4,497 |
| Dow Jones | 4 hours | n/a | 126 | 38.10 | 10,911 EUR | -9,752 |
| Nasdaq 100 | 15 min | n/a | 2,411 | 26.67 | 10,021 EUR | -4,128 |
| DAX 40 | 1 hour | n/a | 1,433 | 29.59 | 7,895 EUR | -3,987 |
| Nasdaq 100 | 10 min | n/a | 2,435 | 25.95 | 6,328 EUR | -4,866 |
| S&P 500 | Daily | n/a | 133 | 31.58 | 5,270 EUR | -1,483 |
| Gold | Daily | n/a | 169 | 31.95 | 3,127 EUR | -1,534 |
| S&P 500 | 1 hour | n/a | 1,471 | 28.48 | 2,947 EUR | -976 |
| Gold | 4 hours | n/a | 394 | 29.44 | 2,284 EUR | -1,137 |
| S&P 500 | 4 hours | n/a | 377 | 34.22 | 2,209 EUR | -1,506 |
| Gold | 30 min | n/a | 2,386 | 23.34 | 1,580 EUR | -1,354 |
| S&P 500 | 30 min | n/a | 2,163 | 25.52 | 1,378 EUR | -900 |
Charts
Top 10 of 27 runs. The full list is in the table above.
The code
// ============================================================== // SMA Close Versus Open Crossover // ProRealAlgos Strategy Library | prorealalgos.com // Type: Trend // Direction: Long only // Timeframe tested: 30 minutes // ============================================================== DEFPARAM CumulateOrders = false closema = Average[241](close) openma = Average[241](open)
11 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 27 market and timeframe combinations. The best run by trade count was USD/JPY, 30 minutes, with 2,659 trades.
The best run had a maximum drawdown of 219,690 USD at the tested position size, against a net result of 352,070 USD.
It only takes long trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.