PureBytes Links
Trading Reference Links
|
BuyPrice=valuewhen(buytest,High)+Gap;+//this will hold the value to
when the buytest signal occured
On 5/25/05, carstuff <grpmail@xxxxxxxxxxxxxxxx> wrote:
> 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);
>
>
>
>
>
>
>
> 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
>
>
>
>
>
>
>
--
Cheers
Graham
http://e-wire.net.au/~eb_kavan/
------------------------ Yahoo! Groups Sponsor --------------------~-->
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/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/
|