You need to use SetForeign("^DJI");
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] Behalf
Of blakerandy
Sent: Sunday, April 01, 2007 7:38 PM
To: [email protected]
Subject: [amibroker] Referencing an indicator in a foreign chart?
Hi all, I'm trying to use the value of an indicator (DMI value for Dow
Jones Industrials)in a system formula for confirmation of market
direction.
I know I need to use the "foreign" function but I can't seem to get it
to reference the DMI value.
Any suggestions?
Code:
EMALong=EMA(Close,21);
EMAShort=EMA(Close,8);
TSA=ATR(14);
PS=ROC(Close,14);
ADXOk =ADX()>20 AND ADX()<50;
OKVol = Volume>100000 ;
PriceOK = Close >=10;
DMI=PDI(10)-MDI(10);
MarketUp = DMI=Foreign("^DJI","close");
MarketDn = DMI=Foreign("^DJI","close");
SetUpL = Cross(EMAShort ,EMALong) AND C>= EMAShort AND MarketUp>0;
SetUpS = Cross(EMALong,EMAShort) AND C<=EMAShort AND MarketDn <0;
Thanks, Randy
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/
For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links