A 2-period average of RSI(13) crossing its 7-period average gives the signal, taken long below 50 and short above 50. Heikin Ashi highs and lows must confirm against a short typical price average. Exits come from the reverse cross inside set RSI zones, with no stop loss.
Best run of 4. EUR/USD, 4 hours, spread 1, from run sweeps:2026-09-17-EURUSD-4h-opt.tsv:2.
| Period | Up to 2026-09-17 |
| Instrument | EUR/USD, 4 hours |
| 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-09-17 |
| startingEquity Equity base added to strategy profit for sizing | 20000 |
| equityPerStep Equity per extra contract | 100000 |
| baseSize Normal size before equity steps | 3 |
| streakSize Size after three winners in a row | 5 |
| lossCut Size reduction after three losers in a row | 2 |
| minSize Minimum contracts | 2 |
| rsiPeriod RSI length | 13 |
| fastSignalPeriod Fast RSI signal line | 2 |
| slowSignalPeriod Slow RSI signal line | 7 |
| priceMAPeriod Typical price SMA used as price filter | 5 |
| midLevel RSI signal midline | 50 |
| longExitCap Long exit only below this | 68 |
| shortExitFloor Short exit only above this | 32 |
Every run
| Market | Timeframe | PF | Trades | Win % | Net | Max DD |
|---|---|---|---|---|---|---|
| EUR/USDBest run | 4 hours | n/a | 805 | 63.11 | 297,807 USD | -236,838 |
| GBP/USD | Daily | n/a | 252 | 63.10 | 32,174 USD | -24,934 |
| DAX 40 | 4 hours | n/a | 543 | 62.80 | 25,700 EUR | -23,885 |
| FTSE 100 | Daily | n/a | 226 | 61.50 | 23,995 EUR | -11,183 |
Charts
The code
Every file in the library uses the same header, the same section order and the same variable names. The numbers above were produced by the original version before the rewrite, and the rewrite has not yet been compiled in ProRealTime.
// ============================================================ // Heikin Ashi TDI Cross // ProRealAlgos Strategy Library | prorealalgos.com // Type: Momentum // Direction: Long & short // Timeframe tested: 4 hours // ============================================================ // --- Settings --- DEFPARAM CumulateOrders = false // --- Parameters --- startingEquity = 20000 // equity base added to strategy profit for sizing equityPerStep = 100000 // each step of this much equity adds one contract baseSize = 3 // normal size before equity steps streakSize = 5 // size after three winning trades in a row lossCut = 2 // size reduction after three losing trades in a row minSize = 2 // never trade fewer contracts than this rsiPeriod = 13 // RSI length fastSignalPeriod = 2 // fast RSI signal line length slowSignalPeriod = 7 // slow RSI signal line length priceMAPeriod = 5 // typical price average used as the price filter midLevel = 50 // RSI signal midline longExitCap = 68 // long exit only while the fast line is below this shortExitFloor = 32 // short exit only while the fast line is above this // --- Indicators --- // Size grows with equity, shrinks after three losers, jumps after three winners. equity = StrategyProfit + startingEquity riskSteps = round(equity / equityPerStep) lossStreak = PositionPerf(1) < 0 AND PositionPerf(2) < 0 AND PositionPerf(3) < 0 winStreak = PositionPerf(1) > 0 AND PositionPerf(2) > 0 AND PositionPerf(3) > 0 IF lossStreak THEN positionSize = Max(abs(round(Max(baseSize + riskSteps - lossCut, riskSteps - lossCut))), minSize) ELSE positionSize = Max(abs(round(Max(baseSize + riskSteps, riskSteps))), minSize) ENDIF IF winStreak THEN positionSize = Max(abs(round(Max(streakSize + riskSteps, riskSteps))), minSize) ENDIF // Heikin Ashi candle. High and low here are the max and min of the HA open and close. haClose = (open + high + low + close) / 4 IF BarIndex > 2 THEN haOpen = (haOpen[1] + haClose[1]) / 2 haHigh = Max(haOpen, haClose) haLow = Min(haOpen, haClose) ENDIF rsiValue = RSI[rsiPeriod](close) fastSignal = Average[fastSignalPeriod](rsiValue) slowSignal = Average[slowSignalPeriod](rsiValue) priceMA = Average[priceMAPeriod](TypicalPrice)[2]
22 more lines: the entry and exit rules.
Read this first
Questions
Yes, the entries and exits are indicator based and ProOrder can run them. With dynamic sizing and no stop, check the behaviour on demo first.
The best run was EUR/USD 4 hours. GBP/USD Daily made USD 32,173.5, DAX 40 4 hours EUR 25,700.2 and FTSE 100 Daily EUR 23,994.7.
Size starts at 3 contracts and never goes below 2. On EUR/USD 4 hours the max drawdown was USD 236,838.0, far above the 20000 starting equity set in the code.
The TDI lines are slow, so 4 hour and Daily bars keep the number of trades reasonable. The DAX 40 4 hour run took 543 trades.
Related
The ProRealAlgos community gets the full rules, the complete code and the automated portfolio.