Join today
Strategies / Trend / HLHB Trend Catcher

HLHB Trend Catcher: EMA Cross With RSI Confirmation

Entries need three things on the same bar: the 5 EMA crossing the 10 EMA, RSI(8) of the median price crossing 50, and a candle whose body is larger than both wicks. It has not been backtested yet, so there are no results to show.

TrendLong & shortSwingNot yet tested
This strategy has not been backtested yet. The rules and code are published now, and the numbers will appear here after the first runs.

Entry rules, long

  1. The signal bar is a bullish candle whose body is larger than both wicks combined
  2. Members only
  3. RSI(8) of the median price crosses above 50
  4. No position is open and no trade has been taken yet in this signal cycle

Entry rules, short

  1. The signal bar is a bearish candle whose body is larger than both wicks combined
  2. Members only
  3. RSI(8) of the median price crosses below 50
  4. No position is open and no trade has been taken yet in this signal cycle

Exit rules

  1. Long: target 262 points, stop 39 points
  2. Short: target 26 points, stop 50 points
  3. Members only
  4. If price is within 7 pips of the trailing level the trade is closed at market

Parameters

positionSize
Contracts per trade
1
fastPeriod
Fast EMA length
5
slowPeriod
Slow EMA length
10
maType
Average type, 1 = exponential
1
rsiPeriod
RSI length on median price
8
rsiMidLevel
RSI midline the RSI must cross
50
takeProfitLongPoints
Long profit target in points
262
stopLossLongPoints
Long stop in points
39
takeProfitShortPoints
Short profit target in points
26
stopLossShortPoints
Short stop in points
50
useHighLowTrail
0 trails on the close, 1 on high / low
0
trailStartPips
Open profit in pips before the trail starts
12
trailBaseShare
Share of open profit locked when the trail starts
0.094
trailStepPips
Extra profit in pips per step of the locked share
6
trailShareIncrement
Relative increase of the locked share per step
0.102
trailRoundOffset
Rounding offset for the step count
-0.5
trailMinDistancePips
If price is closer than this to the trail level, exit at market
7

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.

// ============================================================
// HLHB Trend Catcher
// ProRealAlgos Strategy Library  |  prorealalgos.com
// Type: Trend
// Direction: Long & short
// Timeframe tested: Not yet tested
// ============================================================

// --- Settings ---
DEFPARAM CumulateOrders = false
DEFPARAM PreloadBars = 50000

// --- Parameters ---
positionSize = 1              // contracts per trade
fastPeriod = 5                // fast average length
slowPeriod = 10               // slow average length
maType = 1                    // 1 = exponential average
rsiPeriod = 8                 // RSI length, on median price
rsiMidLevel = 50              // RSI must cross this line to confirm
takeProfitLongPoints = 262    // long target
stopLossLongPoints = 39       // long stop
takeProfitShortPoints = 26    // short target
stopLossShortPoints = 50      // short stop
useHighLowTrail = 0           // 0 = trail on close, 1 = trail on high / low
trailStartPips = 12           // open profit needed before the trail starts
trailBaseShare = 0.094        // share of open profit locked at the start
trailStepPips = 6             // each step of extra profit raises the locked share
trailShareIncrement = 0.102   // relative increase of the locked share per step
trailRoundOffset = -0.5       // rounding offset for the step count
trailMinDistancePips = 7      // closer than this to the level, exit at market

ONCE tradeAllowed = 1         // trading allowed from the first bar

// --- Indicators ---
fastMA = Average[fastPeriod, maType](close)
slowMA = Average[slowPeriod, maType](close)
rsiValue = RSI[rsiPeriod](MedianPrice)
minExitDistance = trailMinDistancePips * PipSize

// A "long candle" has a body wider than both wicks together.
candleBody = abs(close - open)
upperWick = high - max(close, open)
lowerWick = min(close, open) - low
longCandle = candleBody > upperWick + lowerWick
longBullish = longCandle AND open < close
longBearish = longCandle AND open > close

95 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • This strategy has not been backtested, so nothing is known about how it performs on any market.
  • Targets and stops are lopsided: longs aim for 262 points with a 39 point stop, while shorts aim for 26 points with a 50 point stop.
  • The trailing exit uses pips and a share of profit that grows in steps, which is hard to reason about without test data.

Indicators used

EMARSI

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 it be used in ProOrder?

The code is written as an automated system with 1 contract per trade. It has not been compile checked or backtested yet.

Which markets was it tested on?

None so far. No backtest has been run, so there are no instrument results.

How much capital does it need?

Without a backtest there is no drawdown figure to size from. The long stop of 39 points and short stop of 50 points give the per trade risk at 1 contract.

What timeframe does it use?

Signals run on whatever chart the system is loaded on. An earlier 1 hour signal timeframe and hour filter are not part of this version.

Related

Strategies like this one

Monday Dip Buy

Uses the same indicator.

n/a PF · 146 trades

Long-Term Moving Average Cross

Also a trend strategy.

12.31 PF · 61 trades

Slow MACD Slope

Also a trend strategy.

6.80 PF · 7,305 trades

Want to know when this one gets tested? 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