The slippage seems variable since the bid ask spread varies with time of day.
Second, 1 Tick may have different values for different issues ... so assuming you are handling ONE issue at a time you just write the slippage you assume:
BuyPrice = iif(Buy,BuyStp + somevalue,0);
----- Original Message -----
Sent: Sunday, September 14, 2008 8:06 AM
Subject: [amibroker] Buy/Sell price on a stop
Could someone point me in the right direction for the AFL in calculating the slippage of buying or selling on a stop. I searched ticksize and point value to no avail. For example:
BuyStp = HHV(Ref(H,-1),15);
Buy = Cross (High, BuyStp);
BuyPrice = Max (BuyStp, L); I want BuyPrice = Max (BuyStp, L)+ 1 tick ;
In this case of buying on a stop at BuyStp, you will almost never get filled at BuyStp because the ask will be at least 1 tick higher, therefore I would like to adjust the buy price by a certain number of ticks.
Thank you,
James