PDA

View Full Version : Help request on Built in ADX indicator



Edakad
05-26-2014, 04:14 PM
Hello,

There were to functions for ADX, first one is


adx1 = AverageDirectionalMovementIndex (0,CINT(adxPeriod))When I checked the adx1 handle, it can be used to get ADX value with ObjectSeriesGetValue

Now the second function


DirectionalMovementSystemOnArray aryOpen, aryHigh, aryLow, aryClose, CINT(adxPeriod), adx, pdi, mdiThis returns ADX and +DI and -DI.

Is there any method to get the +DI and -DI from the first function, AverageDirectionalMovementIndex

I am asking this because if there is a method to get +DI and -DI from AverageDirectionalMovementIndex itself, then more efficient code can be written where the ADX indicator is used. I think it is possible because this function plots the +DI and -DI on chart.

Thanks

Hassan-HS
05-27-2014, 06:44 AM
Hello,


Sure, you can do this as following:




adx1 = AverageDirectionalMovementIndex (0,CINT(16))
ObjectSeriesGetValue 0,Cstr(adx1 & " +DI"),Bars(0)-1,X
ObjectSeriesGetValue 0,Cstr(adx1 & " -DI"),Bars(0)-1,Y

Edakad
05-27-2014, 07:02 AM
Thank you Hassan