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

Re: Help with "Foreign" and "ADX()"......



PureBytes Links

Trading Reference Links

Keith,
you may have ^NDX ADX() is any formula.
Since ADX() is a function of C, H, L you will temporarily change 
these arrays and then restore them for any further use.

C1=C;H1=H;L1=L;//PRESERVE C,H,L ARRAYS
// REDEFINE NOW C, H, L ARRAYS TO MATCH ^NDX
C=Foreign("^NDX","C");
H=Foreign("^NDX","H");
L=Foreign("^NDX","L");
ADXINDEX=ADX();//THIS IS ^NDX ADX()
Plot(ADXINDEX,"",1,1);
C=C1;H=H1;L=L1;// RESTORE C, H, L ARRAYS FOR ANY FURTHER USE
Plot(ADX(),"",4,1);// THIS IS THE TICKER ADX()
You may continue with the next lines of your code.
Dimitris Tsokakis 

--- In amibroker@xxxx, "Keith Bennett" <kbennett@xxxx> wrote:
> 
> Is there any way to use the FOREIGN function with ADX and DI? 
> Alternatively, are the ADX and DI formulas available anywhere? At 
the 
> moment I note the trade dates using the ADX()/^NDX, and then use:
> 
> Buy if Month()== and Day()== and Year()==.
> 
> It works but it's tedious.
> 
> Keith (B)