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


ADX using EMA rather than Wilder's formula
Started: by Azrael Views / Replies:2,319 / 10
Last Reply: Attachments:0

Welcome to futures io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.


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, and we will never resell your private information.

-- Big Mike

Reply
 
Thread Tools Search this Thread
 

ADX using EMA rather than Wilder's formula

  #11 (permalink)
Elite Member
Haslemere, United Kingdom
 
Futures Experience: Intermediate
Platform: Multicharts 64
Broker/Data: IQFeed, InteractiveBrokers, CQG
Favorite Futures: CL,ES and soft comodities
 
Posts: 5 since Oct 2013
Thanks: 5 given, 0 received

modifying DMI in easylanguage

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

Reply



futures io > > > > ADX using EMA rather than Wilder's formula

Thread Tools Search this Thread
Search this Thread:

Advanced Search



Upcoming Webinars and Events (4:30PM ET unless noted)
 

NinjaTrader 8: Tips and Tricks (part 2)

Mar 2
 

An Afternoon With FIO member @michaelleemoore

Elite only
 

Jigsaw Trading: Keys to successfully trading the open

Mar 9

Macro view: Trump Market Risk w/Piers Curran @ Amplify Trading

Elite only

Reading the Psychology of the Market w/Brett Steenbarger & Trading Technologies

Elite only

Hybrid Machine Learning (R and TradeStation) w/Murray Ruggiero

Elite only

Spring Grains Outlook w/Sean Lusk @ Walsh Trading

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula 1 JohnnyAustin Off-Topic 73 April 15th, 2015 08:08 PM
Welles Wilder Visual 8 stop Compositeman NinjaTrader 2 August 16th, 2012 12:39 PM
Welles Wilder's Trend Balance Point Indicator Search4Truth The Elite Circle 4 June 21st, 2012 08:42 AM
Trading 14 ADX with 20 ema Dragon Traders Hideout 13 June 12th, 2010 10:55 AM
MACD: The 12-period (EMA) minus 26 EMA emini_Holy_Grail Traders Hideout 1 February 22nd, 2010 01:04 PM


All times are GMT -4. The time now is 03:47 PM.

no new posts
Page generated 2017-02-24 in 0.06 seconds with 19 queries on phoenix via your IP 54.146.184.210