In the VolumeShareSlippage model, the price you get is a function of your order size relative to the security's actual traded volume. You provide a volume_limit cap (default 0.25), which limits the proportion of volume that your order can take up per bar. For example: if the backtest is running in one-minute bars, and you place an order for 60 shares; then 100 shares trade in each of the next several minute; and the volume_limit is .25; then your trade order will be split into three orders (25 shares, 25 shares, and 10 shares).

I Just didn't get it.
I know if big size order comes it may will executes by several parts. Yet It should not be separated to trade in different minutes, As talked above. Market price changes so fast so u want your order be executed very very fast[in seconds]
I know the intention's to considering the price impact. Yet it just does not make sense to me to separate into several minutes unless your order size > the total volume in that minute bar.

Any ideas?

1 response

Keep in mind that in the example in the docs, that the stock is very thinly traded. If the stock in question trades only 100 shares per minute, your order is going to impact the price considerably.

That said, it's very easy for you to change the slippage model to something that you think is more representative of the securities you're testing. You could consider both of these variations instead.

set_slippage(slippage.VolumeShareSlippage(volume_limit=1.0, price_impact=.1))


That example would still have a large price impact, but you'd get the order filled more quickly by taking the full trade bar.
 set_slippage(slippage.FixedSlippage(spread=.04))  That example would have a small price impact (2 cents, half of the spread) and it would remove the volume limits. That's a good version for times when you know there are a lot of orders waiting, regardless of the trade volume.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.