Hi everyone,
I am writing my first algorithm based on the community posts and GitHub.
My main target is to trade near market close (3 mins) and have the indicators ready with live data (RSI and self.CalculateReturn). I wrote self.CalculateReturn to calculate return of an equity over a period of time.
I am not sure if the code I have will have the real time value, especially the self.CalculateReturn (I saw some suggestions about a RollingWindow but so far haven't been able to implement).
Any suggestion on improving the code will be greatly appreciated!
Louis Szeto
Hi Chien
The implementation of your attached backtest using historical data will not work, as “today's” bar was not piped. So you'll be using data from Day -6 to Day -1 instead of “today's realtime” price (Day 0). Take a look at this solution from Yuri, a similar logic could fit your need.
Best
Louis
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.
Chien Nguyen
Thanks Louis!
Chien Nguyen
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!