Hello,
Firstly, I realise that it's not a great idea to create an algorithm with just one indicator, but I'm using this as practice to get to know the API and Python a bit better. I'd also appreciate any general advice that you might have regarding the way my algorithm is built - i've tried to base it on similar things i've found.
So lets say I want to use an RSI indicator to select a stock to buy and hold for 5 days, then sell. I should find the range of RSI values that correspond to the most gain. I can think of two ways to do this and I have questions about both.
- Use the built-in optimisation functions. I could take the three parameters (RSI minimum, RSI maximum and RSI window length) and vary them all with the optimisation function. I've read that this costs money to do, but I can't find any information regarding the pricing. Do i have to be concerned that I might accidentally end up paying a large amount? Can I limit my potential spending here?
2. Buy a large amount of stocks and see which go up and which go down and their corresponding RSI values at the time of purchase. In other words - Run a backtest for a few years and plot the gain/loss of a trade on one axis and the RSI at time of purchase on the other axis. Any help turning what i've submitted below into something like i've described would be appreciated. I can't figure out how I would do something like this.
Many thanks,
Luke
Varad Kabade
Hi Luke,
Use the built-in optimisation functions. I could take the three parameters (RSI minimum, RSI maximum and RSI window length) and vary them all with the optimisation function. I've read that this costs money to do, but I can't find any information regarding the pricing. Do i have to be concerned that I might accidentally end up paying a large amount? Can I limit my potential spending here?
Refer to the following thread for information regarding using the optimizer. Let me point that we can only optimize two parameter at the moment.
Buy a large amount of stocks and see which go up and which go down and their corresponding RSI values at the time of purchase.
We could make a historical data request and create a list of historical RSI values, then use the closing prices of the history to find the "winning" trades and compare with the historical RSI. An alternative way would be to run a backtest for the past period to record the values and then run a recent one.
Best,
Varad Kabade
Luke Blades
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!