Trading Articles
Article Categories
Article Tools
ADX using EMA rather than Wilder's formula
Updated October 21, 2016
Top Posters
looks_one
Azrael
with 4 posts (0 thanks)
looks_two
kaan
with 3 posts (0 thanks)
looks_3
Fat Tails
with 3 posts (6 thanks)
looks_4
cactus363
with 1 posts (0 thanks)
trending_up
5,063 views
thumb_up
6 thanks given
group
5 followers
forum
10 posts
attach_file
0 attachments
Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to
register in order to view the content of the threads and start contributing to our community.
It's free and simple.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
ADX using EMA rather than Wilder's formula
(login for full post details)
#1 (permalink )
Jurong Singapore
Experience: Beginner
Platform: NinjaTrader
Broker: Optimus Futures/Rithmic
Trading: TF
Posts: 72 since Jul 2012
Thanks: 39 given,
8
received
Hi guys,
I read somewhere that there is a version of the ADX/DMI that is calculated using EMA instead of Wilder's formula.
I couldn't find it in the forums, does anyone have it?
Thanks in advance =)
Can you help answer these questions from other members on futures io?
Best Threads (Most Thanked) in the last 7 days on futures io
(login for full post details)
#2 (permalink )
Market Wizard
Berlin, Europe
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,855 since Mar 2010
Thanks: 4,238 given,
26,731
received
Azrael
Hi guys,
I read somewhere that there is a version of the ADX/DMI that is calculated using EMA instead of Wilder's formula.
I couldn't find it in the forums, does anyone have it?
Thanks in advance =)
Wilder's average and the EMA are basically identical.
The only difference is the way that the smoothing constant of the EMA is calculated from the period.
For Wilder's average the smoothing constant is k = 1/n
For the EMA (as described by Jack K. Hutson in one of the early issues of the TASC magazine) a period of k = 2/(n+1) is used.
The advantage of the Hutson formula is that
- the EMA can be compared to a SMA with the same period
- that you can easily calculate higher timeframe EMAs by multiplying the period with the timeframe factor
Example: You can approximate an EMA(20) on an hourly chart with an EMA(80) calculated from 15 minute bars, but you cannot do this with Wilder's average.
Therefore today, all EMAs use the Hutson formula ( I call it Hutson formula, but in reality it is based on the single exponential model described in Robert G.Brown's "Smoothing, Forecasting and Prediction of Discrete Time Series, which was first published in 1963).
You do not need the modified ADX based on the EMA .
All you need to do is to adapt the period. Let us call the modified ADX "ADXmod". And now let us assume that you wish to display an ADXmod(21). Then you know that this indicator uses a smoothing constant of 2/(21+1) = 1/11. It is therefore identical with the ADX(11) of Wilder.
That said, you cannot approximate even periods of the ADXmod with the Wilder ADX, as it will not allow you to set the period to 10.5, although this is mathematically possible. If you wish, I will modify the NinjaTrader ADX to allow you to select broken periods.
The following 6 users say Thank You to Fat Tails for this post:
(login for full post details)
#3 (permalink )
Jurong Singapore
Experience: Beginner
Platform: NinjaTrader
Broker: Optimus Futures/Rithmic
Trading: TF
Posts: 72 since Jul 2012
Thanks: 39 given,
8
received
Thanks for the reply Fat Tails!
Actually, I was trying to get an ADX with the EMA reference in it to then substitute with the various MAs like HMA, ZELMA, T3, etc for experimentation =)
Something like the MACDplus in the forums where you can just swap the MA for the calculations part.
Like something of wikipedia,
Quoting
+DI = 100 times exponential
moving average of +DM divided by
average true range
−DI = 100 times exponential moving average of −DM divided by average true range
The exponential moving average is calculated over the number of periods selected, and the average true range is an exponential average of the true ranges. Then:
ADX = 100 times the exponential moving average of the absolute value of (+DI − −DI) divided by (+DI + −DI)
Variations of this calculation typically involve using different types of moving averages, such as a weighted moving average or an adaptive moving average.
So the idea is to change all the MAs used in calculations for +DI, -DI, ATR and ADX. =)
(login for full post details)
#4 (permalink )
Market Wizard
Berlin, Europe
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,855 since Mar 2010
Thanks: 4,238 given,
26,731
received
Azrael
Thanks for the reply Fat Tails!
Actually, I was trying to get an ADX with the EMA reference in it to then substitute with the various MAs like HMA, ZELMA, T3, etc for experimentation =)
Something like the MACDplus in the forums where you can just swap the MA for the calculations part.
Like something of wikipedia,
So the idea is to change all the MAs used in calculations for +DI, -DI,
ATR and ADX. =)
This is definitely possible, but it is a bit of work to code it.
(login for full post details)
#5 (permalink )
Jurong Singapore
Experience: Beginner
Platform: NinjaTrader
Broker: Optimus Futures/Rithmic
Trading: TF
Posts: 72 since Jul 2012
Thanks: 39 given,
8
received
Fat Tails
This is definitely possible, but it is a bit of work to code it.
Sent you a PM, if you haven't seen it.
Maybe continue from there =)
(login for full post details)
#6 (permalink )
Kampala + Uganda
Posts: 7 since May 2014
Thanks: 3 given,
1
received
Azrael
Hi guys,
I read somewhere that there is a version of the ADX/DMI that is calculated using EMA instead of Wilder's formula.
I couldn't find it in the forums, does anyone have it?
Thanks in advance =)
Azrael, did you ever succeed in achieving the ADX based on EMA.
Am coming from a forex background and tried Fat Tails advice of 2/(n+1) = 1/n but it hasnt helped.
FxPro has MT5 which has both types of ADX, I played around with the inputs but failed to get matches.
Please share it if you ever succeeded, this thread seems a dead horse but I will try.
Thanks
(login for full post details)
#7 (permalink )
Jurong Singapore
Experience: Beginner
Platform: NinjaTrader
Broker: Optimus Futures/Rithmic
Trading: TF
Posts: 72 since Jul 2012
Thanks: 39 given,
8
received
kaan
Azrael, did you ever succeed in achieving the ADX based on EMA.
Am coming from a forex background and tried Fat Tails advice of 2/(n+1) = 1/n but it hasnt helped.
FxPro has MT5 which has both types of ADX, I played around with the inputs but failed to get matches.
Please share it if you ever succeeded, this thread seems a dead horse but I will try.
Thanks
Hey,
Fat Tails made it for me
I uploaded it on BMT here: https://futures.io/local_links_search.php?action=show&userid=31270&sort=d
I no longer use it actually (I'm mostly a stock investor now) and I'm using a different set of indicators.
But I hope it is helpful for you!
Warmest regards
Azrael
(login for full post details)
#8 (permalink )
Kampala + Uganda
Posts: 7 since May 2014
Thanks: 3 given,
1
received
Azrael
Hey,
Fat Tails made it for me
I uploaded it on
BMT here: ....
I no longer use it actually (I'm mostly a stock investor now) and I'm using a different set of indicators.
But I hope it is helpful for you!
Warmest regards
Azrael
Thanks Azreal, but am not an elite member, is it ok to post the indicator here
(login for full post details)
#9 (permalink )
Market Wizard
Berlin, Europe
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
Posts: 9,855 since Mar 2010
Thanks: 4,238 given,
26,731
received
kaan
Thanks Azreal, but am not an elite member, is it ok to post the indicator here
Even if the indicator is posted here, elite membership is required for downloading it. At least that was my understanding.
(login for full post details)
#10 (permalink )
Kampala + Uganda
Posts: 7 since May 2014
Thanks: 3 given,
1
received
Fat Tails
Even if the indicator is posted here, elite membership is required for downloading it. At least that was my understanding.
My thanks to you Fat Tails for writing the indicator, I will miss it for now but will get it someday.
May the edge be with you.
(login for full post details)
#11 (permalink )
Haslemere, United Kingdom
Experience: Intermediate
Platform: Sierra Charts
Broker: CQG
Trading: CL,ES,NQ,KC
Posts: 7 since Oct 2013
Thanks: 7 given,
1
received
Hi,
I've been trying to create this indicator (ADX using EMA) for Multicharts and the only helpfull information I've found is in this thread.
I take my hat off to Fat Tails for creating the Ninja version, I dont have ninja but been looking at Fat Tails code trying to reverse engineer and my head hurts
I wonder if Fat Tails or anyone else could help and look at the easylanguage code bellow (this is the standard DMI indicator in multicharts) and hint what values I'd need to change to calculate the ADX using EMA rather than Willder's avarage?
Thanks
Code
inputs:
PriceValueH( numericseries ),
PriceValueL( numericseries ),
PriceValueC( numericseries ),
Len( numericsimple ),
oDMIPlus( numericref ),
oDMIMinus( numericref ),
oDMI( numericref ),
oADX( numericref ),
oADXR( numericref ),
oVolty( numericref ) ;
variables:
var0( 0 ),
var1( 0 ),
var2( 0 ),
var3( 0 ),
var4( 0 ),
var5( 0 ),
var6( 0 ),
var7( 0 ),
var8( 0 ),
var9( 1 / Len ),
var10( 0 ) ;
if CurrentBar = 1 then
begin
for Value1 = 0 to Len - 1
begin
var0 = 0 ;
var1 = 0 ;
var2 = PriceValueH[Value1] - PriceValueH[ Value1 + 1 ] ;
var3 = PriceValueL[ Value1 + 1 ] - PriceValueL[Value1] ;
condition1 = var2 > var3 and var2 > 0 ;
if condition1 then
var0 = var2
else
begin
condition1 = var3 > var2 and var3 > 0 ;
if condition1 then
var1 = var3 ;
end;
var4 = var4 + var0 ;
var5 = var5 + var1 ;
var6 = var6 + TrueRangeCustom( PriceValueH, PriceValueL, PriceValueC )[Value1] ;
end ;
var7 = var4 / Len ;
var8 = var5 / Len ;
oVolty = var6 / Len ;
end
else
begin
var0 = 0 ;
var1 = 0 ;
var2 = PriceValueH - PriceValueH[1] ;
var3 = PriceValueL[1] - PriceValueL ;
condition1 = var2 > var3 and var2 > 0 ;
if condition1 then
var0 = var2
else
begin
condition1 = var3 > var2 and var3 > 0 ;
if condition1 then
var1 = var3 ;
end;
var7 = var7[1] + var9 * ( var0 - var7[1] ) ;
var8 = var8[1] + var9 * ( var1 - var8[1] ) ;
oVolty = oVolty[1] + var9 * ( TrueRangeCustom( PriceValueH, PriceValueL, PriceValueC )
- oVolty[1] ) ;
end ;
if oVolty > 0 then
begin
oDMIPlus = 100 * var7 / oVolty ;
oDMIMinus = 100 * var8 / oVolty ;
end
else
begin
oDMIPlus = 0 ;
oDMIMinus = 0 ;
end ;
var10 = oDMIPlus + oDMIMinus ;
if var10 > 0 then
oDMI = 100 * AbsValue( oDMIPlus - oDMIMinus ) / var10
else
oDMI = 0 ;
condition1 = CurrentBar <= Len and CurrentBar > 0 ;
if condition1 then
begin
oADX = Cum( oDMI ) / CurrentBar ;
oADXR = ( oADX + oADX[ CurrentBar - 1 ] ) * .5 ;
end
else
begin
oADX = oADX[1] + var9 * ( oDMI - oADX[1] ) ;
oADXR = ( oADX + oADX[ Len - 1 ] ) * .5 ;
end ;
DirMovement = 1 ;
Last Updated on October 21, 2016
Right now
Ongoing
Right now
March
Register to Attend
Elite only
Coming soon
April