Join today
Strategies / Trend / ADX Momentum EMA

ADX Momentum EMA: a stacked trend filter with an ADX cross trigger

Price has to sit on the right side of four moving averages while ADX, Momentum, Williams %R and Stochastic all agree on direction. The actual entry fires on the bar where ADX(10) crosses one of a set of fixed levels. This version has not been backtested yet, so no results are published.

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. Close is above the 8 EMA, the 34 WMA, the 15 TEMA and the 200 EMA
  2. The last two closes were also above the 8 EMA and this bar makes a higher high than the previous bar
  3. The 150 WMA and the 15 TEMA are both rising
  4. Stochastic(8,3) is higher than 3 bars ago
  5. ADX(10) is above 18, DI+ is above DI- and ADX(6) is not falling
  6. Momentum(6) is rising and Williams %R(40) is above -50
  7. Members only
  8. No long position is open

Entry rules, short

  1. Close is below the 8 EMA, the 34 WMA, the 15 TEMA and the 200 EMA
  2. The 150 WMA and the 15 TEMA are both falling
  3. Stochastic(8,3) is lower than 3 bars ago
  4. ADX(10) is above 18, DI- is above DI+ and ADX(6) is not falling
  5. Momentum(6) is falling and Williams %R(40) is below -50
  6. ADX(10) crosses above 22, 24 or 26 on this bar
  7. Members only

Exit rules

  1. Stop loss 30 points
  2. Profit target 120 points
  3. Members only
  4. The ladder follows the current close, so the locked level can step back down if price falls back

Parameters

positionSize
Contracts per trade
1
fastPeriod
Fast EMA, price must be on the right side of it
8
midPeriod
Weighted MA, price must be on the right side of it
34
slopePeriod
Weighted MA whose slope sets the trend direction
150
temaPeriod
TEMA used for price position and slope
15
trendPeriod
Long-term EMA trend filter
200
momentumPeriod
Momentum must be rising (long) or falling (short)
6
fastAdxPeriod
Short ADX that must not be falling
6
diPeriod
DI+ / DI- length
10
adxPeriod
Main ADX length
10
adxThreshold
Main ADX must be above this
18
williamsPeriod
Williams %R length
40
williamsMidLevel
Williams %R side that separates bulls from bears
-50
stochPeriod
Stochastic %K length
8
stochSmooth
Stochastic smoothing
3
stochLookback
Stochastic compared with its value this many bars ago
3
closesAbovePeriod
Last closes that must sit above the fast EMA (long)
2
adxLevelA
ADX cross levels that can trigger an entry
17
adxLevelB
ADX cross levels that can trigger an entry
20
adxLevelC
ADX cross levels that can trigger an entry
22
adxLevelD
ADX cross levels that can trigger an entry
24
adxLevelE
ADX cross levels that can trigger an entry
26
adxLevelF
ADX cross levels that can trigger an entry
28
adxLevelG
ADX cross levels that can trigger an entry
30
stopLossPoints
Protective stop
30
takeProfitPoints
Profit target
120
ladderRungs
Number of breakeven ladder steps
25
firstTriggerPips
Profit that arms the first ladder step
10
firstLockPips
Profit locked by the first step
5
secondTriggerPips
Profit that arms the second step
15
ladderStepPips
Spacing of every later step
10

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.

// ============================================================
// ADX Momentum EMA
// 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 = 8            // fast EMA, price must be on the right side of it
midPeriod = 34            // weighted MA, price must be on the right side of it
slopePeriod = 150         // weighted MA whose slope sets the trend direction
temaPeriod = 15           // TEMA used for price position and slope
trendPeriod = 200         // long-term EMA trend filter
momentumPeriod = 6        // momentum must be rising (long) or falling (short)
fastAdxPeriod = 6         // short ADX that must not be falling
diPeriod = 10             // DI+ / DI- length
adxPeriod = 10            // main ADX length
adxThreshold = 18         // main ADX must be above this
williamsPeriod = 40       // Williams %R length
williamsMidLevel = -50    // Williams %R side that separates bulls from bears
stochPeriod = 8           // Stochastic %K length
stochSmooth = 3           // Stochastic smoothing
stochLookback = 3         // Stochastic compared with its value this many bars ago
closesAbovePeriod = 2     // last closes that must sit above the fast EMA (long)
adxLevelA = 17            // ADX cross levels that can trigger an entry
adxLevelB = 20
adxLevelC = 22
adxLevelD = 24
adxLevelE = 26
adxLevelF = 28
adxLevelG = 30
stopLossPoints = 30       // protective stop
takeProfitPoints = 120    // profit target
ladderRungs = 25          // number of breakeven ladder steps
firstTriggerPips = 10     // profit that arms the first ladder step
firstLockPips = 5         // profit locked by the first step
secondTriggerPips = 15    // profit that arms the second step
ladderStepPips = 10       // spacing of every later step

// --- Indicators ---
fastMA = ExponentialAverage[fastPeriod](close)
midMA = WeightedAverage[midPeriod](close)
slopeMA = WeightedAverage[slopePeriod](close)
temaValue = TEMA[temaPeriod](close)
trendMA = ExponentialAverage[trendPeriod](close)
momentumValue = Momentum[momentumPeriod](close)
fastAdx = ADX[fastAdxPeriod]
plusDI = DIplus[diPeriod](close)
minusDI = DIminus[diPeriod](close)
adxValue = ADX[adxPeriod]
williamsValue = Williams[williamsPeriod](close)
stochK = Stochastic[stochPeriod, stochSmooth](close)

aboveFast = fastMA < close
belowFast = fastMA > close
aboveMid = midMA < close
belowMid = midMA > close
aboveTrend = trendMA < close
belowTrend = trendMA > close
aboveTema = temaValue < close
belowTema = temaValue > close
slopeUp = slopeMA > slopeMA[1]
slopeDown = slopeMA < slopeMA[1]
temaUp = temaValue > temaValue[1]
temaDown = temaValue < temaValue[1]
williamsBull = williamsValue > williamsMidLevel
williamsBear = williamsValue < williamsMidLevel
stochRising = stochK > stochK[stochLookback]
stochFalling = stochK < stochK[stochLookback]

50 more lines: the entry and exit rules.

Read this first

Known weaknesses

  • No backtest exists for this version, so there is no evidence yet that the rules make money on any market.
  • Eight long conditions and seven short conditions must line up at once, which can leave long stretches with no trades and makes the logic easy to overfit.
  • The breakeven ladder follows the current close, so a locked level can step back down when price retraces, giving back profit you might think is protected.
  • Long and short sides only check their own position, so a signal on one side can reverse an open trade on the other.

Indicators used

EMAWMATEMAADXMomentumWilliams %RStochastic

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 I run the ADX Momentum EMA strategy in ProOrder?

The code is written for ProOrder automatic trading, but it has not been compile checked or backtested yet. Run it in ProBacktest on your own market before going live.

Which markets was it tested on?

None so far. The page will show results per instrument once backtests are done.

How much capital does it need?

Default size is 1 contract with a 30 point stop, but without a backtest there is no drawdown figure to size capital from. Treat any live use as untested.

Why does the entry need an ADX cross?

The other filters only describe the trend state. The ADX(10) cross above 17, 20, 22, 24, 26, 28 or 30 (longs) gives a single bar where trend strength is picking up, so the trade has a clear trigger.

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 see how this one does once it is tested? Join the ProRealAlgos community 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