Hi team,my code is create insight with 20day and i can confirm from log
2024-07-01 12:00:00 : emitt MSTR RBGP9S2961YD 20 days, 0:00:00
2024-07-01 12:00:00 : emitt GSAH WWLQTC5JUC85 20 days, 0:00:00
2024-07-01 12:00:00 : emitt VST WKELFN09PUN9 20 days, 0:00:00
2024-07-01 12:00:00 : emitt ALNY SZ18XERVT9ID 20 days, 0:00:00
2024-07-01 12:00:00 : emitt CHWY X5BUF5UE90F9 20 days, 0:00:00
2024-07-01 12:00:00 : emitt DUOL XQHYFIZ1GYN9 20 days, 0:00:00
2024-07-01 12:00:00 : emitt RIVN XTDCDCDRI6HX 20 days, 0:00:00
however, in backtest pannel i saw period get messed with other period.
Date Time Symbol Direction Period Confidence Weight
2024-07-01 12:00:00 MSTR Up 20d 00h:00m:00s None
2024-07-01 12:00:00 VRT Up 20d 00h:00m:00s None
2024-07-01 12:00:00 VST Up 25d 11h:59m:59s None
2024-07-01 12:00:00 ALNY Down 04d 11h:59m:59s None
2024-07-01 12:00:00 CHWY Down 04d 11h:59m:59s None
2024-07-01 12:00:00 DUOL Down 00d 11h:59m:59s None
2024-07-01 12:00:00 RIVN Down 25d 11h:59m:59s None
my code are usign those provided models and didn't insert other code that could mutate the insight period.
self.set_portfolio_construction(EqualWeightingPortfolioConstructionModel(self.RebalanceFunction))
self.set_risk_management(MaximumDrawdownPercentPerSecurity(self.risk))
self.set_execution(ImmediateExecutionModel())
Mia Alissi
To address the issue of insight periods appearing differently in logs and backtest results, here are some steps and considerations based on the documentation and API details:
Insight Creation and Logging: Ensure that when you create insights, you are consistently setting the period using a
timedelta
object. Your logs confirm that insights are being emitted with a 20-day period, which is correct.Insight Period Mutation: There might be a discrepancy in how the period is being interpreted or displayed in the backtest results. The
SerializedInsight
class has aperiod
property that should be set correctly. Ensure that no other part of your code or any model is altering this period after insight creation.Backtest Configuration: Verify that the backtest environment is correctly configured and that there are no settings or models that might affect the insight periods. The models you are using (
EqualWeightingPortfolioConstructionModel
,MaximumDrawdownPercentPerSecurity
, andImmediateExecutionModel
) should not inherently alter insight periods.Time Zone and Date Handling: Check if there are any time zone conversions or date manipulations that might affect how the period is calculated or displayed. Ensure that all date and time handling is consistent with UTC, as this is the standard for QuantConnect.
Additional Logging: Add more detailed logging around the insight creation and handling to capture any changes in the period value. This can help identify if and where the period might be getting altered.
Testing in Isolation: Create a minimal test case that isolates the insight creation and period setting to confirm the behavior without interference from other components. This can help determine if the issue is with the insight creation or elsewhere in the algorithm.
By following these steps, you should be able to identify and resolve the discrepancy between the logged insight periods and those shown in the backtest results. If the issue persists, consider reaching out to QuantConnect support for further assistance.
Sources: Backtest Analysis - QuantConnect.com, Key Concepts - QuantConnect.com, Insight Manager - QuantConnect.com, Forecasting Stock Prices Using A Temporal CNN Model
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.
Oliver
to rule out impact of other models, i changed to
it still gives me different period than i set
Oliver
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!