Hi everyone!
When backtesting one strategy I got some good results in performance but noticed warnings “fill at stale price”.
The problem was because of daily resolution so I fixed this and got quite bad results with negative performance.
As I see it, “stale price” here brought us to evaluating a signal in the morning and using close of the previous day price so we kinda look into the future.
Am I missing something and is there some way to fix the “stale price” problem here without loosing all the strategy?
Best regards,
Sergey
Derek Melchin
Hi Sergey,
The algorithm above fills as stale prices because we are subscribing to daily data but are placing a Scheduled Event intraday. To avoid filling at stale prices, we should remove the Scheduled Event and add the following snippet to the bottom of the `OnData` method:
See the attached backtest for reference.
Instead of removing the Scheduled Event, an alternative option to resolve the stale price fills is to subscribe to minute resolution data for all of the securities in the algorithm. Refer to this related thread for an example of subscribing to minute data for the VIX index.
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.
Sergey Kolpakov
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!