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

[amibroker] SetForegn Issue



PureBytes Links

Trading Reference Links

Hi All;

I am not sure what could be wrong here but I use the following code to
set to different contract.. I use the high/low/close from the foreign
contract to run through a formula and calculate buy/sell signals and
restore values..

however, the values between SetForeign/restore are not generated based
on the SetForeign  - NG2200402 - contract prices.. it is like there
was not setforeign at all??

Datecheck_1= DateNum() >= 1031229 AND DateNum() < 1040128;
SetForeign("NG2200402");

price_trend = ..some calculations
price_trigger=some calculations

price_trend_buy=Cross(price_trigger, price_trend);
price_trend_sell=Cross(price_trend, price_trigger);


B_1=price_trend_buy ;
S_1=price_trend_sell ;

Buy=(datecheck_1 AND B_1);
Sell=(Datecheck_1 AND S_1);
Short = Sell; // it is a stop and reverse system and this point
Cover = Buy

RestorePriceArrays( True );


for some reason the price_trend and price_trigger are always
calculated on the primary ticker that I have opened on the screen ..
my intention is to generate buy/sells on foreign contract and then use
it on primary contract contract

Tks
Paul