ADX using EMA rather than Wilder's formula - futures io
futures io futures trading



ADX using EMA rather than Wilder's formula


Discussion in NinjaTrader

Updated
      Top Posters
    1. looks_one Azrael with 4 posts (0 thanks)
    2. looks_two kaan with 3 posts (0 thanks)
    3. looks_3 Fat Tails with 3 posts (6 thanks)
    4. looks_4 cactus363 with 1 posts (0 thanks)
    1. trending_up 5,057 views
    2. thumb_up 6 thanks given
    3. group 5 followers
    1. forum 10 posts
    2. 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)

 
Search this Thread
 

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 =)

Started this thread Reply With Quote

Journal Challenge February 2021 results (so far):
Competing for $1500 in prizes from Topstep
looks_oneSBtrader82 's Trading Journalby SBtrader82
(140 thanks from 28 posts)
looks_twoJust BEING a Trader: Letting Go!!by iqgod
(106 thanks from 27 posts)
looks_3Wisdom is Emptinessby Mtype
(66 thanks from 24 posts)
looks_4Deetee’s DAX Trading Journal (time based)by Deetee
(30 thanks from 14 posts)
looks_5Journal for peanuts1956by peanuts1956
(23 thanks from 13 posts)
 
 
(login for full post details)
  #2 (permalink)
Market Wizard
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,855 since Mar 2010
Thanks: 4,238 given, 26,726 received


Azrael View Post
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.

Reply With Quote
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. =)

Started this thread Reply With Quote
 
(login for full post details)
  #4 (permalink)
Market Wizard
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,855 since Mar 2010
Thanks: 4,238 given, 26,726 received


Azrael View Post
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.

Reply With Quote
 
(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 View Post
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 =)

Started this thread Reply With Quote
 
(login for full post details)
  #6 (permalink)
Kampala + Uganda
 
 
Posts: 7 since May 2014
Thanks: 3 given, 1 received


Azrael View Post
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

Reply With Quote
 
(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 View Post
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

Started this thread Reply With Quote
 
(login for full post details)
  #8 (permalink)
Kampala + Uganda
 
 
Posts: 7 since May 2014
Thanks: 3 given, 1 received


Azrael View Post
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

Reply With Quote
 
(login for full post details)
  #9 (permalink)
Market Wizard
Berlin, Europe
 
Experience: Advanced
Platform: NinjaTrader, MultiCharts
Broker: Interactive Brokers
Trading: Keyboard
 
Fat Tails's Avatar
 
Posts: 9,855 since Mar 2010
Thanks: 4,238 given, 26,726 received


kaan View Post
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.

Reply With Quote
 
(login for full post details)
  #10 (permalink)
Kampala + Uganda
 
 
Posts: 7 since May 2014
Thanks: 3 given, 1 received



Fat Tails View Post
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.

Reply With Quote
 
(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 ;

Reply With Quote


futures io Trading Community Platforms and Indicators NinjaTrader > ADX using EMA rather than Wilder's formula


Last Updated on October 21, 2016


Upcoming Webinars and Events
 

NinjaTrader Indicator Challenge!

Ongoing
 

Journal Challenge w/$1500 prizes from Topstep!

February
 

Identifying Setups & Targets Using Profile Charts w/Trevor & Tradovate

Feb 25
 

Battlestations! Show us your trading desk - $1,500 in prizes!

March
     



Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
All information is for educational use only and is not investment advice.
There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts