I am new to QuantConnect but it seems weird that the backtest can never go past 12/25/2024.
I can start from 10/2/2024 and end on 1/3/2025, but the backtest still ends at 12/25/2024.
If I start after 12/25/2024, the behavior is the same; e.g. when I go from 1/5/2025 to 2/5/2025, the logs show that I started and ended on 12/25/2024 (even though I started after this point).
Here is what I have:
def initialize(self):
self.set_start_date(2024, 12, 20)
self.set_end_date(2025, 1, 30)
self.set_cash(20000)
future = self.add_future(ticker = Futures.Indices.MICRO_NASDAQ_100_E_MINI, resolution = Resolution.Second, extended_market_hours = True)
future.set_filter(min_expiry_days = 0, max_expiry_days = 183)
def on_data(self, data: Slice):
pass
Mia Alissi
Based on your code and the information retrieved from the QuantConnect API and documentation, it appears that your issue is not related to incorrect usage of the
set_start_date
andset_end_date
methods. Both methods are correctly used to define the start and end dates of your backtest. Here's a recap of what these methods do and how they should be used in your QuantConnect algorithm:set_start_date(year, month, day)
: Sets the starting date of the backtest. You are using it correctly withself.set_start_date(2024, 12, 20)
.set_end_date(year, month, day)
: Sets the end date of the backtest. You are using it correctly withself.set_end_date(2025, 1, 30)
.add_future
method: This method subscribes to future contracts and allows configuration of expiry filters. Your use ofadd_future
to add NASDAQ-100 E-mini futures seems correct with the proper filter set.Potential Causes and Next Steps:
Data Limitations or Availability Issues: The issue of ending on 12/25/2024 might be due to limitations in the data available on QuantConnect for future contracts, particularly for the NASDAQ-100 E-mini. Check if there are known issues or data updates required beyond this date.
Technical Limitations: Verify any system notifications or logs for potential errors indicating why the backtest doesn't proceed past the said date.
Contact Support: Reach out to QuantConnect's support team or community forums to inquire if there are known limitations or issues regarding backtesting NASDAQ-100 E-mini futures past 12/25/2024.
Debugging Tips:
Debugging Logs: Include additional logs to confirm the actual end date being used by the engine. Use
self.debug()
to print important checkpoints within theinitialize
andon_data
functions.Try a Different Instrument or Date: As an experimental approach, attempt to run a simpler algorithm with a different instrument or start and end dates to rule out localized data issues with the NASDAQ-100 E-mini contracts.
By following these steps, you can pinpoint the exact issue with your backtest's finishing date. If it is a limitation of the data or platform, QuantConnect's support would be best positioned to assist further.
Sources: Getting Started - QuantConnect.com
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.
QuantHeart
I see “Out of Sample” in the backtest result. How can I get more data?
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.
QuantHeart
This other post worked for me:
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!