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

Re: [amibroker] Buy/Sell price on a stop



PureBytes Links

Trading Reference Links

James, you could use tick value indirectly.
 
You would need to define them and then reference them. Since you are talking about tick values, you are considering commodities / futures which are moreless limited in numbers ... so here is the concept.
 
You will need to do some string manipulation to get the root symbol ("ES" from "ESU8 for example) in order to get the associations correct.
 
Define:
ES_Tick = 0.25;
etc...
 
Root    = StrLeft(Name(),2);  // from "ESxx", it will return "ES"
if (Root == "ES")    TickValue = ES_Tick;  // will need multiple of these statements - one for each symbol used.
 
BuyPrice = iif(Buy,BuyStp + TickValue,0); 
 
 
 
 
----- Original Message -----
From: James
Sent: Monday, September 15, 2008 7:45 AM
Subject: Re: [amibroker] Buy/Sell price on a stop

Ara,

 

Point 1 I can live with. Point 2 is why I would like to use the tick value. When testing one contract at a time, I can handle this issue buy adding 1 or 2 or 3 etc tick values to the commission. But if I want to test a portfolio of contracts, the tick value would be helpful because they are all different. Do you think it is possible to use tickvalue in the AFL formula?

 

James



----- Original Message ----
From: Ara Kaloustian <ara1@xxxxxxxxxx>
To: amibroker@xxxxxxxxxxxxxxx
Sent: Sunday, September 14, 2008 10:29:22 AM
Subject: Re: [amibroker] Buy/Sell price on a stop

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 -----
From: James
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


__._,_.___

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html




Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___