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

RE: [amibroker] SetForegn Issue



PureBytes Links

Trading Reference Links

When this symptom appears it means your SetForeign statement has failed.
This means AB could not find the listed symbol. Check for spaces, typos,
etc.

 

You can get the result back to code to warn yourself like this:

 

Found = SetForeign("NG2200402");

if (NOT Found) warning = "Foreign ticker was not found"; else warning = "";

warning;

RestorePriceArrays();

 

>From help:


SYNTAX 

SetForeign( ticker, fixup = True, tradeprices = False ) 


RETURNS

NUMBER 


FUNCTION 

The SetForeign function replaces current price/volume arrays with those of
foreign security, returns True (1) if ticker exists, False (0) otherwise.

 

 

-----Original Message-----
From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
Of PKJR
Sent: Tuesday, June 13, 2006 5:13 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] SetForegn Issue

 

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

 

 


 

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 other support material please check also:

http://www.amibroker.com/support.html

 

 

Yahoo! Groups Links

 

    http://groups.yahoo.com/group/amibroker/

 

    amibroker-unsubscribe@xxxxxxxxxxxxxxx

 

    http://docs.yahoo.com/info/terms/