LEAN is the open source
algorithmic trading engine powering QuantConnect. Founded in 2013 LEAN has been built by a
global community of 80+ engineers and powers more than a dozen hedge funds today.
Alpha League Competition: $1,000 Weekly Prize Pool
Qualifying Alpha Streams Reentered Weekly Learn
more
How are fills processed in the paper trade broker, is it using the ask price for buy orders and bid for sell orders, or is it using the last price for the order fills?
What I am seeing is that trades in the paper trade brokerage almost always have a 0.01 - 0.02 better fill than trades being placed in my Interactive Brokers account, where I have the same strategy running locally and connecting to TWS API.
These trades are for the Index ETFs (QQQ, SPY, IWM, and DIA), so liquidity should not be an issue.
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.
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.
Alexandre Catarino
100.3k
,
We use last trade price for the fills. Please checkout the docs under the Reality Modelling section where we explain how to set up a custom slippage model to account for slippage:
// Assigning securities custom slippage models:
Securities["SPY"].SlippageModel = new CustomSlippageModel()
// Custom slippage implementation
public class CustomSlippageModel : ISlippageModel {
public decimal GetSlippageApproximation(Security asset, Order order) {
return 0.1m;
}
}
1
Petter Hansson
10.5k
,
I'm studying the same subject at the moment. Reading the link above, I wasn't aware that custom fill models were possible, so I will try that next. Simply putting additional slippage on top of my limit orders won't really cut it for my intraday algo.
0
Petter Hansson
10.5k
,
Implemented a custom fill model tonight that gradually fills orders assuming the worst regarding price, it was very worth the effort. I will share it later on if I'm certain it's free of bugs.
0
Tim De Lise
1.6k
,
Hi Alexandre Catarino I was wondering what the returned value there actually means, since a simple explanation of that is missing from the docs. So 0.1 means 0.1 percent or 0.001 for slippage?
0
Edited by Tim De Lise
Alexandre Catarino
100.3k
,
It refers to units of account currency. In this particular case: $0.1.
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.
Loading...
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!