[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to apply functions to other than tickers?



PureBytes Links

Trading Reference Links

not easy, because ADX uses DM ( dir movement ) that use High, low
OBV has one fixed value.
Stephane
for example the code of ADX is below


Periods= Optimize("Enter time periods",7,7,40,1);

PlusDM= IIf(High>Ref(High,-1) AND
Low>=Ref(Low,-1), High-Ref(High,-1),
IIf(High>Ref(High,-1) AND Low<Ref(Low,-1)
AND High-Ref(High,-1)>Ref(Low,-1)-Low,
High-Ref(High,-1),0));
DIPlus= 100 * Wilders(PlusDM,Periods) /
ATR(Periods);

MinusDM= IIf(Low<Ref(Low,-1) AND
High<=Ref(High,-1), Ref(Low,-1)-Low,
IIf(High>Ref(High,-1) AND Low<Ref(Low,-1)
AND High-Ref(High,-1)<Ref(Low,-1)-Low,
Ref(Low,-1)-Low, 0));
DIMinus= 100 * Wilders(MinusDM,Periods) /
ATR(Periods);

DIDif= abs(DIPlus - DIMinus);
DISum= DIPlus + DIMinus;
ADXRaw= 100 * Wilders(DIDif/DISum, Periods);

Plot(ADXRaw,"",2,1);
> 
> Is it possible to apply functions (which do not take arrays for 
> parameters) to my own arrays of data? For example I would like to 
> calculate the ADX of the OBV indicator... but ADX only looks at 
the 
> current ticker symbol, not an input array.
> 
> So is there a way to do this, or do I have to duplicate the code 
for ADX 
> in some way?
> 
> The intent is to discover when OBV turns over but without the 
delay of 
> MA and without the ambiguity of Zig.
> 
> -- John