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

[amibroker] AFL basic help needed please



PureBytes Links

Trading Reference Links

Hello,

I am trying to write a system for back testing a Gap system. The problem I
run into is that I want to buy only when the stock reaches Today's High +
the Gap amount, Today's High being the High when the buy is triggered. Since
I cannot put that figure into a static variable, and that amount may not be
triggered for several days, how do I accomplish this? I tried the code
below, but since Today's High is a dynamic array, it keeps changing with
every new day? Thanks for any help.

Tom


LowTest=Ref(L,-1); //Yesterday's Low
HighTest=Ref(H,-1); //Yesterday's High


BuyTest=Low>HighTest; //See if today's Low is higher than yesterdays High

Gap=IIF(BuyTest,Low-HighTest,0); // See how much the gap is


BuyPrice=High+Gap;// I want to buy at TODAY's HIGH + GAP THIS IS THE AMOUNT
I NEED TO KEEP STATIC FOR EACH NEW DAY"S COMPARISON


BuyStop=BuyPrice;
Buy=BuyTest AND Cross(High,Buystop);






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Has someone you know been affected by illness or disease?
Network for Good is THE place to support health awareness efforts!
http://us.click.yahoo.com/Rcy2bD/UOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/