I see in the documentation
https://www.quantconnect.com/docs/algorithm-reference/trading-and-orders#Trading-and-Orders-Time-In-ForceI dont see ImmidiateOrCancel But https://www.quantconnect.com/lean/documentation/topic5963.html
I do see ImmidiateOrCancel mentioned.
1. so please clarify this.
2. if ImmidiateOrCancel is valid, how long does the order will be open?
3. In backtesting can we use this?
4. how to get partially filled order quantity with ImmidiateOrCancel?
Shile Wen
Hi Keerthan,
ImmediateOrCancel orders are not currently supported. The only TimeInForce values supported are GoodTilCanceled, Day, and GoodTilDate. Refer to the source code here.
Best,
Shile Wen
Keerthan kumar
Thanks for responding!!
1. since GoodTilDate is supported if I give date as next 10 millisecond, it will be as good as ImmediateOrCancel . can this work?
2. how to get partially filled order quantity with GoodTilDate?
3. Any other workaround for ImmidiateOrCancel?
Derek Melchin
Hi Keerthan,
We can't simulate an ImmediateOrCancel order with the GoodTilDate TimeInForce because it only works with dates, not datetimes. Notice how in the source code, the seconds/minutes/hours of the expiry time are ignored when determining if the order is expired.
A possible workaround to simulate ImmediateOrCancel orders would be to subscribe to data with high-resolution, submit an order on one timestep and cancel it on the next.
To find the filled quantity of an order, we can utilize the QuantityFilled property of the OrderTicket . However you will need to implement a fill model, refer to this algorithm for an example, since the default model fills immediately.
Best,
Derek Melchin
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.
Keerthan kumar
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!