Welcome! Log In Create A New Profile

Get Earnings and Seasonal Trends - Subscribe Today!

Advanced

Think or swim ADX indicator

Posted by tizznit 
Think or swim ADX indicator
September 11, 2014 06:13PM
I am having problems with my adx indicator on think or swim compared to my uncle and cousins indicator on Charles schwab. I like the adx length set at 14 and we are getting different numbers. Theirs is more accurate than mine so I would like it to match theirs. We are using the 5min charts and trading it with the parabolic psar. I think think or swim is taking the 14 length from the previous 5 minute candles and schwab is taking the 14 length from the current candle and previous 13 candles. I am totally clueless on how to make a code to change this and was wondering if someone would be kind enough to make one for me. Also if you are able to tell me if I am right about my thinking that think or swim is taking the 14 length from the previous 14 candles.
Thanks
Re: Think or swim ADX indicator
September 11, 2014 06:59PM
This is the code that TOS uses for ADX. As written, it starts with the current candle then includes the 13 prior.

#
# TD Ameritrade IP Company, Inc. (c) 2008-2014
#

declare lower;

input length = 14;

def hiDiff = high - high[1];
def loDiff = low[1] - low;

def plusDM = if hiDiff > loDiff and hiDiff > 0 then hiDiff else 0;
def minusDM =  if loDiff > hiDiff and loDiff > 0 then loDiff else 0;

def ATR = WildersAverage(TrueRange(high, close, low), length);
plot "DI+" = 100 * WildersAverage(plusDM, length) / ATR;
plot "DI-" = 100 * WildersAverage(minusDM, length) / ATR;

def DX = if ("DI+" + "DI-" > 0) then 100 * AbsValue("DI+" - "DI-" ) / ("DI+" + "DI-" ) else 0;
plot ADX = WildersAverage(DX, length);

"DI+".SetDefaultColor(GetColor(1));
"DI-".SetDefaultColor(GetColor(8));
ADX.SetDefaultColor(GetColor(5));

edit to remove automatic smileys



Edited 1 time(s). Last edit at 09/11/2014 07:00PM by robert.
Re: Think or swim ADX indicator
September 11, 2014 07:15PM
Thank you, Do you think you can send me one the doesn't count the current candle just to compare? I really appreciate the help.
Re: Think or swim ADX indicator
September 11, 2014 07:43PM
not including the current candle would be the same as looking at the ADX from the previous candle. if you want to do it, though, just replace the plot ADX line above with this

plot ADX = WildersAverage(DX[1], length);
Re: Think or swim ADX indicator
September 12, 2014 09:03AM
Thanks for the replies, but we haven't noticed any difference in these numbers from TOS adx indicator. I tried both of the things that you recommended, but the adx is the exact same.
Thanks again
Sorry, only registered users may post in this forum.

Click here to login