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

Go Back   futures.io

> Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader


ADX using EMA rather than Wilder's formula
Started:April 9th, 2013 (10:17 AM) by Azrael Views / Replies:2,150 / 10
Last Reply:October 21st, 2016 (01:12 PM) 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

Old October 21st, 2016, 01:12 PM   #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 > Futures Trading, News, Charts and Platforms > Platforms and Indicators > NinjaTrader > 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)
 

Al Brooks: Stop Losing when a Good Trade goes Bad, Correcting Mistakes

Elite only
 

Trading Technologies: Algo Design Lab hands-on

Dec 13

Normal webinar schedule resumes after the holidays

January
     

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 06:00 PM.

Copyright © 2016 by 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
Page generated 2016-12-08 in 0.07 seconds with 19 queries on phoenix via your IP 54.159.129.152