Join waitlist
Strategies / Trend / Five Bar Slope Short Crossover

Five Bar Slope Short Crossover

Sells short when the 9-period EMA crosses under the 21-period EMA while both averages are falling over 5 bars. Covers the short when the 9-period EMA crosses back over the 21-period EMA, with no stop or target.

TrendShort onlySwingUSD/JPYDaily
1.90Profit factor
2,346,000Net profit USD
33.05%Win rate
233Trades
-403,950Max drawdown
10,069Avg trade

Best run of 2. USD/JPY, Daily, spread 1, from run pf:2026-10-04-USDJPY-D.tsv:12.

Entry rules, short

  1. The 9-period EMA's 5-bar slope per bar is below -0.0002% of price
  2. The 21-period EMA's 5-bar slope per bar is below -0.00008% of price

Exit rules

  1. The 9-period EMA crosses over the 21-period EMA, closing the short position

Test conditions

PeriodUp to 2026-10-04
InstrumentUSD/JPY, Daily
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-04

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
USD/JPYBest runDaily1.90 23333.052,346,000 USD-403,950
Brent CrudeDailyn/a 8923.607,080 EUR-5,840

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// Five Bar Slope Short Crossover
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Short only
// Timeframe tested: Daily
// ==============================================================

DEFPARAM CumulateOrders = false

fastma = ExponentialAverage[9](close)
slowma = ExponentialAverage[21](close)
fastslope = (fastma - fastma[5]) / 5
slowslope = (slowma - slowma[5]) / 5

13 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

EMA
Longer historyRe-run on up to 1,000,000 barsUSD/JPY · Daily · older data 0.00 USD

USD/JPY had no history beyond the standard run, so both runs used 12,000 bars.

USD/JPY · Daily

Bars available12,000
Net, standard 200,000-bar run2,346,000.00 USD
Net, long run2,346,000.00 USD
Net on the older data alone0.00 USD
Read this firstKnown weaknesses2 points
  • The code sets no stop loss, so a losing trade stays open until an exit signal arrives.
  • Results include the spread only. Commissions and overnight financing are not included.

Questions

About this strategy

Can I run Five Bar Slope Short 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 2 market and timeframe combinations. The best run was USD/JPY, Daily, with a profit factor of 1.90 over 233 trades.

How large was the drawdown?

The best run had a maximum drawdown of 403,950 USD at the tested position size, against a net result of 2,346,000 USD.

Does it trade long, short or both?

It only takes short trades.

Related

Strategies like this one

Reversal Pattern With Chaikin Volatility

Uses the same indicator.

2.26 PF · 6,872 trades

Trend Surfer

Best run on the same market, USD/JPY.

1.04 PF · 10,813 trades

200-Period Average Downside Crossover

Also a trend strategy.

1.91 PF · 185 trades

Put your name on the ProRealAlgos waitlist to trade a tested portfolio instead of single strategies.

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