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

[amibroker] Re: Slippage/Commission (was PORTFOLIO TRADER v1.04)



PureBytes Links

Trading Reference Links

--- "Chuck Rademacher" <chuck_rademacher@x> wrote:
> In the case of slippage, however, it would be even
> better (again IMO) to be able to specify a different 
> percentage depending on the price. I think you would 
> agree that lower priced stocks are likely to
> have higher slippage.

Although I am a very green learner with respect to what can and can 
not be done with these new backtesters (Fred and UM have done some 
amazing work), here is an idea that works in regular AFL.

First, set AB's commission settings to 0 (zero). Then use the 
following code modified to your own assumptions about slippage.

//***************************************************
slippage = 0.50 + 2/open; 
BuyPrice = CoverPrice = Open * (1 + slippage/100);//
SellPrice = ShortPrice = Open * (1 - slippage/100);//

/***************************************************
Code above will give a minimum slippage of 0.50% and 
then increases the slippage estimate as an inverse of
price.
A $100 stock will have slippage of 0.52%
A $10 stock will have slippage of 0.70%
A $1 stock will have slippage of 2.50%
A 50 cent stock will have slippage of 4.5%
****************************************************/

b


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get A Free Psychic Reading! Your Online Answer To Life's Important Questions.
http://us.click.yahoo.com/Lj3uPC/Me7FAA/ySSFAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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