From February 26th investors will no longer be able to use Stop or Good Till Cancelled order types on the NYSE, according to a recent press release from Reuters.
Typically Stop Market orders are used to place a market order when the stock exceeds a trigger price. On August 24th, 2015 many investors had their positions stopped out far below the stop prices they had entered. This is a known behavior of stop orders which cannot guarantee a certain execution price.
The difference between the market price, and the fill price is called slippage. In QuantConnect you can model slippage using our TransactionModel class. It would be wise to create a fill model which predicts a greater slippage in volatile market conditions. Most of the time this slippage is assumed to be negative (you execute at a price worse than expected), but occasionally you can even receive positive slippage (a better price than you expected).
To set a custom slippage model in QuantConnect you can use the code below:
//$2 per trade transaction model, with custom slippage.Securities["AAPL"].TransactionModel = new MyTransactionModel(2.00m);
public class MyTransactionModel : ConstantFeeTransactionModel {
public override decimal GetSlippageApproximation(Security security, Order order) {
// If volatile, return high value for slippage.
}
}
To prevent negative slippage with Stop orders investors should use a Stop Limit order which places a limit order when the market exceeds the trigger price. Stop Limit orders are not guaranteed to be filled but they do ensure you get your expected fill price or better.
To submit a Stop Limit order with QuantConnect you can use the code below:
var newStopLimitOrderTicket = StopLimitOrder("IBM", 10, stopPrice, limitPrice);
At QuantConnect we will continue supporting Stop, Stop Limit and GTC Orders across all our supported brokerages using software techniques. This will ensure your algorithm can continue as expected with no interruptions. We believe you are sophisticated enough to harnesspowerful types and we won't artificially restrict the tools in your arsenal!
Happy Coding!
Jared Broad
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!