Rank: Advanced Member
Groups: Moderators, Registered, Registered Users, Subscribers Joined: 10/8/2010(UTC) Posts: 1,960
Thanks: 92 times Was thanked: 155 time(s) in 150 post(s)
|
Originally Posted by: gorachand Hello MS Support, I copied the code for the variables from ADX Custom---and this code works to some extent---but still does not tally with the ADX on TradingView where I put the periods equal to 8 and DI length equal to 13 Here is the modified code PlusDM:=If(H>Ref(H,-1) AND L>=Ref(L,-1), H-Ref(H,-1),If(H >Ref(H,-1) AND L<Ref(L,-1)
AND H-Ref(H,-1)>
Ref(L,-1)-L, H-Ref(H,-1),0)); MinusDM:=If(L<Ref(L,-1) AND H<=Ref(H,-1), Ref(L,-1)-L,If(H>Ref(H,-1) AND L<Ref(L,-1)
AND H-Ref(H,-1)<Ref(L,-1)-L, Ref(L,-1)-L,0)); PlusDI:= 100*Wilders(PlusDM,13)/ATR(13); MinusDI:= 100*Wilders(MinusDM,13)/ATR(13); ADXFinal:= Wilders(Abs(PlusDI-MinusDI)/PlusDI+MinusDI,8); ADXFinal;
Hi again, That looks like it would be the correct modification, but I am not familiar with TradingView's platform. Keep in mind that this MetaStock Custom ADX is slightly different than even the MetaStock built-in ADX in that it keeps the decimal values. However, if you use the MetaStock Custom ADX with the standard values for all variables, it should generally match the MetaStock built-in ADX with the same setting (i.e. use 14 for the built-in ADX and use 14 for all custom ADX variables) and compare the outputs of both. After that, I would compare the MetaStock built-in ADX with the TradingView ADX using the same settings. If these don't match, then I would not expect the Custom ADX to match either. Update: So I did a basic comparison on their site using TSLA with ADX 14 for both variables. There were some differences that could be accounted for by rounding. When I used your preferred settings (13 for the +/- DI) and 8 for the ADX calculation I got a result of 21.2445 for 7/27/2023 for TSLA.O.
When I used ADX Smoothing 8 and DI length 13 on TradingView for TSLA they show 21.24 which seems pretty comparable. Edited by user Friday, July 28, 2023 2:48:16 PM(UTC)
| Reason: Not specified
|