Join waitlist
Strategies / Momentum / EMA MACD RSI State Machine

EMA MACD RSI State Machine

The strategy buys when the close crosses the 100-period or 600-period EMA while above the 25-period EMA, MACD is above zero and RSI(14) is above 50. It sells short on the mirror setup and closes positions when a false or done signal appears.

MomentumLong & shortSwingFTSE 1004 hours
n/aProfit factor
1,414Net profit EUR
52.59%Win rate
424Trades
-1,346Max drawdown
3.34Avg trade

Best run of 3. FTSE 100, 4 hours, spread 2, from run sweeps:2026-10-11-FTSE100-4h-opt.tsv:35.

Entry rules, long

  1. The MACD line is above zero and RSI(14) is above 50
  2. This is the first bar of a run of signals, and the state is long

Entry rules, short

  1. The MACD line is below zero and RSI(14) is below 50
  2. This is the first bar of a run of signals, and the state is short

Exit rules

  1. Short-state done signal: RSI(14) at or above 60 with the 25-period EMA above the 100 or 600-period EMA
  2. Long-state done signal: RSI(14) at or below 40 with the 25-period EMA below the 100 or 600-period EMA

Test conditions

PeriodUp to 2026-10-11
InstrumentFTSE 100, 4 hours
Spread2 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-11

Every run

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
FTSE 100Best run4 hoursn/a 42452.591,414 EUR-1,346
US Crude OilDailyn/a 15759.875,353 EUR-4,493
Dow Jones4 hoursn/a 13157.254,802 EUR-4,429

Charts

Results by run

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// EMA MACD RSI State Machine
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long & short
// Timeframe tested: 4 hours
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE arr = 0
ONCE myNext = 0

ea = ExponentialAverage[25](close)
eb = ExponentialAverage[100](close)
ec = ExponentialAverage[600](close)
myMacd = MACDline[12,26,9](close)
myRsi = RSI[14](close)

108 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

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

Questions

About this strategy

Can I run EMA MACD RSI State Machine 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 3 market and timeframe combinations. The best run by trade count was FTSE 100, 4 hours, with 424 trades.

How large was the drawdown?

The best run had a maximum drawdown of 1,346 EUR at the tested position size, against a net result of 1,414 EUR.

Does it trade long, short or both?

It trades both long and short.

Related

Strategies like this one

Trend Surfer

Uses the same indicator.

1.04 PF · 10,813 trades

DAX Survivor

Best run on the same market, FTSE 100.

1.17 PF · 1,514 trades

ATR Momentum

Also a momentum strategy.

n/a PF · 15,021 trades

Get the full rules, the complete code and the ProRealAlgos portfolio as a member.

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