Join waitlist
Strategies / Trend / SMA Close Versus Open Crossover

SMA Close Versus Open Crossover

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.

TrendLong onlyIntradayUSD/JPY30 min
n/aProfit factor
352,070Net profit USD
28.02%Win rate
2,659Trades
-219,690Max drawdown
132Avg trade

Best run of 27. USD/JPY, 30 min, spread 1, from run sweeps:2026-10-12-USDJPY-30m-opt.tsv:13.

Entry rules, long

  1. Buys 1 contract at market when no long position is open

Exit rules

  1. The 241-bar SMA of closes moves back below the 241-bar SMA of opens, closing the long at market

Test conditions

PeriodUp to 2026-10-12
InstrumentUSD/JPY, 30 minutes
Spread1 points
Starting capital1,000,000
CostsSpread only. Commissions and overnight financing are not included.
BarsUp to 200,000 bars, fewer where the instrument has less history
Last tested2026-10-12

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest run30 minn/a 2,65928.02352,070 USD-219,690
USD/JPY1 hourn/a 1,88029.52409,000 USD-361,600
USD/JPY10 minn/a 2,61828.76255,530 USD-185,050
EUR/USD4 hoursn/a 56632.6952,729 USD-32,880
Nikkei 225Dailyn/a 14032.1447,755 USD-16,333
Nasdaq 100Dailyn/a 9740.2129,004 EUR-4,670
Dow JonesDailyn/a 15534.8428,969 EUR-11,805
DAX 40Dailyn/a 11336.2819,709 EUR-5,047
Nikkei 2254 hoursn/a 39628.5417,403 USD-12,336
Nikkei 22530 minn/a 2,64224.4517,307 USD-10,898
Nasdaq 1004 hoursn/a 35627.8115,437 EUR-4,882
Nasdaq 1001 hourn/a 1,42626.6513,820 EUR-4,358
Nasdaq 10030 minn/a 1,96225.7913,605 EUR-4,327
Dow Jones1 hourn/a 52534.6711,890 EUR-7,274
Nikkei 2251 hourn/a 1,36927.7611,613 USD-9,142
Dow Jones30 minn/a 98830.9711,071 EUR-4,497
Dow Jones4 hoursn/a 12638.1010,911 EUR-9,752
Nasdaq 10015 minn/a 2,41126.6710,021 EUR-4,128
DAX 401 hourn/a 1,43329.597,895 EUR-3,987
Nasdaq 10010 minn/a 2,43525.956,328 EUR-4,866
S&P 500Dailyn/a 13331.585,270 EUR-1,483
GoldDailyn/a 16931.953,127 EUR-1,534
S&P 5001 hourn/a 1,47128.482,947 EUR-976
Gold4 hoursn/a 39429.442,284 EUR-1,137
S&P 5004 hoursn/a 37734.222,209 EUR-1,506
Gold30 minn/a 2,38623.341,580 EUR-1,354
S&P 50030 minn/a 2,16325.521,378 EUR-900

Charts

Results by run

Top 10 of 27 runs. The full list is in the table above.

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// 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

How to load it

  1. Copy the code with the copy button on the code block.
  2. In ProRealTime, open a chart of the instrument and timeframe you want to test, then open ProOrder > New trading system and choose "Create with programming".
  3. Paste the code, give the system a name and save it.
  4. Click "Backtest", set your own spread and position size, and run it before you consider trading it live.

Indicators used

SMA
Read this firstKnown weaknesses3 points
  • No profit factor is available, because only sweep results exist for this strategy.
  • The maximum drawdown of 219,690 USD is large next to the net profit of 352,070 USD.
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.

Questions

About this strategy

Can I run SMA Close Versus Open Crossover in ProOrder?

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.

Which markets was it tested on?

It was tested on 27 market and timeframe combinations. The best run by trade count was USD/JPY, 30 minutes, with 2,659 trades.

How large was the drawdown?

The best run had a maximum drawdown of 219,690 USD at the tested position size, against a net result of 352,070 USD.

Does it trade long, short or both?

It only takes long trades.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

EMA 8 21 RSI Filtered Bracket

Best run on the same market, USD/JPY.

1.09 PF · 6,194 trades

ADX Filtered EMA Cross

Also a trend strategy.

1.15 PF · 607 trades

See how ProRealAlgos combines strategies like this into one automated portfolio.

The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.

Past backtest results do not guarantee future results. This is not financial advice. Curated and maintained by ProRealAlgos. ProRealTime™ is a trademark of ProRealTime SAS. prorealalgos.comStatsDocs