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

Re: [amibroker] Buyprice questions



PureBytes Links

Trading Reference Links

G'day all,

Just looking and running with my code and I realised I'm not actually 
referencing tomorrows high. If my BUY conditions are met today, it is 
executed at open tomorrow because of my buy delay of 1. But, how do i 
now reference this new day, prior to buying, to check whether it's High 
is higher than yesterday's High??

A tad confused...

Andrew.

> G'day all,
>
> Being an utter noob to AFL, I have a few questions. If I want to specify
> a buy at a price one tick above the previous day's high will the
> following work?
>
> ************************
> // simple key reversal
>
> H1 = Ref(H, -1);
> C1 = Ref(C, -1);
> L1 = Ref(L, -1);
>
> Capital = 10000;
> PositionSize = -15;
> RoundLotSize = 1;
> TickSize = 0.01;
>
> Buy = L < L1 AND C > C1;
> BuyPrice= H1 + TickSize;
> ************************
>
> (My entry to this trade is set with a buy delay of 1 in the backtester
> settings so once my BUY condition is met, it won't take effect til the
> next bar )
>
> Will Buyprice work like this? And will  my Buyprice be yesterday's close
> plus something above it? That is, if the price jumps 5 cents, will it
> still execute?
>
> I hope i've clearly explained what I'm trying to do..
>
> Thanks,
>
> Andrew.



------------------------ Yahoo! Groups Sponsor --------------------~--> 
In low income neighborhoods, 84% do not own computers.
At Network for Good, help bridge the Digital Divide!
http://us.click.yahoo.com/EpW3eD/3MnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.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/