Join waitlist
Strategies / Momentum / RSI Zigzag Trend Flip

RSI Zigzag Trend Flip

The system buys when a zigzag built from RSI(5) swing levels flips from down to up, and closes the long when it flips back down. The swing levels are the closes at RSI(5) crossovers of 25 and 75, with a 1% reversal threshold.

MomentumLong onlySwingS&P 5001 hour
1.51Profit factor
3,245Net profit EUR
38.96%Win rate
249Trades
-763Max drawdown
13.03Avg trade

Best run of 44. S&P 500, 1 hour, spread 1, from run pf:2026-10-12-USA500-1h.tsv:2.

Entry rules, long

  1. No long position is open when the trend turns up.

Exit rules

  1. A long position closes when the trend flips down.

Test conditions

PeriodUp to 2026-10-12
InstrumentS&P 500, 1 hour
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
S&P 500Best run1 hour1.51 24938.963,245 EUR-763
USD/JPY4 hoursn/a 8140.74394,650 USD-345,800
USD/JPY30 minn/a 16636.75386,650 USD-216,090
USD/JPY1 hourn/a 18038.33323,690 USD-289,130
USD/JPY10 minn/a 8639.53237,580 USD-189,960
Nikkei 2254 hoursn/a 7644.7442,915 USD-13,224
SilverDailyn/a 5547.2730,584 USD-25,287
Silver15 minn/a 34037.6529,015 USD-18,395
Nikkei 2251 hourn/a 23740.0828,832 USD-7,038
Dow JonesDailyn/a 5257.6927,317 EUR-11,142
Silver30 minn/a 41435.0226,104 USD-23,350
DAX 40Dailyn/a 5347.1720,793 EUR-5,511
Nasdaq 1004 hoursn/a 9549.4717,526 EUR-5,069
Dow Jones30 minn/a 11346.0216,328 EUR-5,226
Dow Jones1 hourn/a 7352.0516,253 EUR-5,881
Nasdaq 1001 hourn/a 30338.6115,675 EUR-5,399
Nasdaq 100Dailyn/a 4663.0413,438 EUR-4,006
Dow Jones4 hoursn/a 2955.1711,951 EUR-8,952
Nasdaq 10030 minn/a 35440.119,789 EUR-4,854
Nasdaq 1003 minn/a 9639.588,052 EUR-3,046
Dow Jones5 minn/a 8442.867,570 EUR-6,848
Nasdaq 1005 minn/a 12634.927,242 EUR-3,365
Nasdaq 10015 minn/a 27142.806,421 EUR-5,387
Nasdaq 1001 minn/a 4341.866,308 EUR-2,809
DAX 4015 minn/a 23238.365,860 EUR-3,052
DAX 401 hourn/a 26537.745,615 EUR-5,294
S&P 5004 hoursn/a 9052.225,412 EUR-1,179
S&P 500Dailyn/a 5561.825,079 EUR-1,238
FTSE 100Dailyn/a 4250.005,060 EUR-3,082
Nasdaq 1002 minn/a 7440.544,617 EUR-2,581
DAX 405 minn/a 10340.783,796 EUR-2,205
S&P 50030 minn/a 25744.363,262 EUR-1,582
GoldDailyn/a 5949.153,205 EUR-1,534
Gold1 hourn/a 24340.742,712 EUR-1,186
Gold15 minn/a 19340.412,517 EUR-1,218
Gold30 minn/a 27037.782,430 EUR-1,465
Gold4 hoursn/a 10648.112,302 EUR-1,404
Gold10 minn/a 16639.162,124 EUR-864
Gold5 minn/a 14042.862,019 EUR-876
FTSE 10015 minn/a 17940.781,812 EUR-1,591
S&P 5005 minn/a 8444.051,515 EUR-699
S&P 5003 minn/a 6245.161,262 EUR-578
Gold2 minn/a 10242.161,245 EUR-813
S&P 5001 minn/a 2540.00528 EUR-527

Charts

Results by run

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

Net profitMax drawdown

The code

ProBuilder code, as tested

// ==============================================================
// RSI Zigzag Trend Flip
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Momentum
// Direction: Long only
// Timeframe tested: 1 hour
// ==============================================================

DEFPARAM CumulateOrders = false

ONCE lastlong = 0
ONCE lastshort = 0
ONCE trend = 1
ONCE hh = 0
ONCE ll = 0

myRsi = RSI[5](close)

34 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

RSI
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 RSI Zigzag Trend Flip 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 44 market and timeframe combinations. The best run was S&P 500, 1 hour, with a profit factor of 1.51 over 249 trades.

How large was the drawdown?

The best run had a maximum drawdown of 763 EUR at the tested position size, against a net result of 3,245 EUR.

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

CCI Sign With EMA Alignment

Best run on the same market, S&P 500.

1.23 PF · 1,253 trades

MACD Zero Line Two-Way Crossover

Also a momentum strategy.

1.51 PF · 405 trades

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

Copy trading on US indices is available to ProRealAlgos members as spots open.

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