I am running a basic MACD crossover on the EURJPY. I am looking at when the insights are emitted, and it doesn't match up with the Trading View chart. Not only that, the insight summary is showing different dates than the insight count chart.
From the trading view chart of the EURJPY with daily resolution, there should be an insight emitted on Jan 2, 13, and 21. The algo emits insights on Jan 1, 4, 13, and 23 on the summary and Dec 30, Jan 6, and 20 on the chart. Why?
Tamim Fund
I have put a log message in the Update function in the Alpha Model and it seems it is only getting new data sporadically, about once every 2-20 days. The resolution is set to minute and there is a daily consolidator. What is happening?
Derek Melchin
Hi Tamim Fund,
It's common for TradingView algorithms to have slightly different results compared to LEAN. This is a result of differences in the data used to run the backtest.
As for the discrepancy in dates between the Insight Summary table and the Insight Count plot, I've forwarded this bug to our UX team to resolve. Thanks for reporting it.
In regards to the second post above, it appears the Update method is only being called sporadically because of this logic:
direction = InsightDirection.Flat if sd.MACD.Current.Value > sd.MACD.Signal.Current.Value * (1 + self.bounceThresholdPercent): direction = InsightDirection.Up elif sd.MACD.Current.Value < sd.MACD.Signal.Current.Value * (1 - self.bounceThresholdPercent): direction = InsightDirection.Down if direction == sd.PreviousDirection: continue algorithm.Log(f"time: {algorithm.Time}... ") sd.PreviousDirection = insight.Direction
In the above snippet, the log is only hit when the insight direction has changed. If we moved the log to the top of the method, we'd see it's receiving minutely data.
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.
Tamim Fund
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!