Does anyone have a good tutorial of implementing slippage? I've tried invoking it as a Transaction Model but it complains about it not being a correct cast. Are we not allowed to do this? Securities["VXX"].TransactionModel = new ConstantSlippageModel(0.001m); Thanks.
Michael Handschuh
A transaction model is a combination of a fee model/fill model/slippage model all in one type. The constant slippage model needs to be assigned to the SlippageModel property instead of the TransactionModel property.
Securities["VXX"].SlippageModel = new ConstantSlippageModel(0.001m);
Here's the Security class with the various models that can be set.Stephen Oehler
Stephen Oehler
I had an additional message here about how I couldn't get it to work, but I simply had forgotten the namespace. Thanks!
Michael Handschuh
For others with a similar issue, you'll need to add a using statement at the top of the code file:
using QuantConnect.Orders.Slippage
Marc Nunes
Marc Nunes
for(int i=0;i
Warren Harding
Stephen Oehler
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!