Hi guys,
Hope you're all well. I have the following issue: I want to take a subset of available data for a stock and work out an indicator for the chosen period. For example, the average day-to-day % stock change from 2013 - 2014.
I then want to use that indicator for a backtest from 2014 - present, while updating it dynamically.
Does anyone know how to do this in cSharp?
Thanks in advance
Hugo
Gurumeher Sawhney
Hi Hugo, Here is a potential solution:
The algorithm can implement SetWarmUp and run through the previous years data. This will prime the technical indicators before the backtesting starts. Then during the backtesting these indicators are used and updated. Below is a backtest to show the following.
QuantConnect provides more than 100 technical indicators already so it will be worth your time to look through the reference table. If these are not sufficient it is possible to create custom indicators (also in the documentation).
Hugo Lu
Ok great - thank you Gurumeher. Let me take a look at SetWarmUp and the code you attached and I will get back if I have any more questions!
Hugo
Hugo Lu
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!