Join today
Strategies / Momentum / Heikin Ashi TDI Cross

Heikin Ashi TDI Cross: RSI Signal Lines With Heikin Ashi Filters

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.

MomentumLong & shortSwingEUR/USD4 hours
n/aProfit factor
297,807Net profit USD
63.11%Win rate
805Trades
-236,838Max drawdown
370Avg trade

Best run of 4. EUR/USD, 4 hours, spread 1, from run sweeps:2026-09-17-EURUSD-4h-opt.tsv:2.

Entry rules, long

  1. Members only
  2. The fast line is below 50
  3. Heikin Ashi high is above the 5-period typical price SMA from 2 bars ago

Entry rules, short

  1. Members only
  2. The fast line is above 50
  3. Heikin Ashi low is below the 5-period typical price SMA from 2 bars ago

Exit rules

  1. Members only
  2. Close a short when the fast line crosses above the slow line between 32 and 50 and the Heikin Ashi high is above the price SMA
  3. No stop loss or target

Test conditions

PeriodUp to 2026-09-17
InstrumentEUR/USD, 4 hours
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-09-17

Parameters

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

Markets and timeframes tested

MarketTimeframePFTradesWin %NetMax DD
EUR/USDBest run4 hoursn/a 80563.11297,807 USD-236,838
GBP/USDDailyn/a 25263.1032,174 USD-24,934
DAX 404 hoursn/a 54362.8025,700 EUR-23,885
FTSE 100Dailyn/a 22661.5023,995 EUR-11,183

Charts

Results by run

Net profit against max drawdown

Net profitMax drawdown
0-250K-125K250K500KEUR/USD · 4 hoursGBP/USD · DailyDAX 40 · 4 hoursFTSE 100 · Daily

The code

ProBuilder, rewritten to house standard

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

Known weaknesses

  • No stop loss or profit target. A trade only closes on the indicator exit, so losses are open ended.
  • The best run's max drawdown of USD 236,838.0 is close to its USD 297,807.0 net profit.
  • Position size changes with equity and win or loss streaks (minimum 2 contracts), which makes results hard to compare with fixed size systems.
  • Only sweep data exists, so profit factor was not recorded.

Indicators used

RSISMAHeikin AshiTraders Dynamic Index

How to load it

  1. Copy the code with the copy button above 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.

Questions

About this strategy

Can this run in ProOrder?

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.

Which markets were tested?

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.

How much capital is needed?

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.

Why higher timeframes?

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

Strategies like this one

Bollinger Squeeze

Uses the same indicator.

14.30 PF · 86 trades

Slow MACD Slope

Best run on the same market, EUR/USD.

6.80 PF · 7,305 trades

Twelve Minus Two Momentum

Also a momentum strategy.

12.00 PF · 52 trades

Swap ideas on indicator combinations with fellow ProRealTime traders. Join the ProRealAlgos waitlist.

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