Dear QC Community,
Limit orders with TimeInForce set to “Day” never get executed when daily data is used, no matter what the limit price is.
I guess this is expected to some but was a surprise to me. Is there a way around this without increasing the bar resolution (*)? Technically it should be possible to consider limit orders with just daily OHLC bars.
(*) When using large universes on inter-day strategies, increasing the resolution will result in significantly increased backtest latency without the algorithm actually using the additional data.
Best Regards.
Alexandre Catarino
Hi Raffaele ,
Thank you for your patience.
Unfortunately, there is no way alternative to using higher frequency data.
TimeInForce.Day will compare the time of the order against the closing time (4 pm for US Equities). If the algorithm uses daily data, it will submit an order at 12 am and only evaluate whether it was filled at 12 am of the next day which has passed the market close.
Alternatively, you can use GTD:
so that the limit order will expire after 1 day which I think it's the equivalent of TimeInForce.Day for Daily resolution.
Raffaele
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!