Hello,
When I change a parameter like the RSI Period from 10 to 14 or the RSI Value to 63 from 65 the results don't change at all and I was hoping someone could tell me why.
Also my code isn't taking trades after the bar closes to and seems to not be following my requirements at all when I look for trades through Thinkorswim. Please help me figure out why this is, thank you in advance!
Louis Szeto
Hi Jacob
I was unable to reproduce your problem, changing the parameter you've said did change the entry and backtest result. Did you change it on “main.py”? Or you've only changed on your backup template “Algo.py”? You need to change “main.py" in ordet to do the changes..
Cheers
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.
Jacob Barbee
Yes, I changed it on the main.py and it did not change my results at all. Also, the entries to my trades are not correct but my requirements look right so I don't know why the code is not taking trades at the right time.
Louis Szeto
I used the exact same code copied from you attached backtest, changing RSI Period from 10 to 14 or the RSI Value to 63 from 65 in “main.py” indeed will alter the results slightly. Maybe just the difference is not so obvious, as you're using minute resolution so the difference in 14 bars is not large.
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.
Jacob Barbee
It should be in 5 minute resolution because the indicators are registered to that the timeframes accordingly into the code.
When I look at thinkorswim or tradingview.com the code isn't taking the trades when the requirements are met. What could be the cause of this?
Louis Szeto
I guess your self.lastfiveminutemacdvalues[0] & self.lastonehourmacdvalues[0] should actually be self.lastfiveminutemacdvalues[-1] & self.lastonehourmacdvalues[-1] ?? List is appending like stack at its end, unlike rolling window push at head, although I suggest you might consider using the later, then the set length queue can handle the popping itself.
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.
Jacob Barbee
So you're saying I should switch it from what I currently have to rolling window functions instead, for a smoother application?
Jacob Barbee
Also, the bot should only buy after the close of the 5 minute candle when all requirements are met, but that is not the case in the backtest. It seems to be buying periodically during the 5 minute candle formation and not when the requirements are even met. Why might this be the case?
Louis Szeto
Hi Jacob
My opinion will be suggesting rolling window for easy management and space concern. See this comment for implementation.
The bot will run OnData every minute as it received slice data, only the bars will update in 5 minute manner. You can set up a check condition to bypass OnData if you need. eg setting timedelta variable
Cheers
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.
Jacob Barbee
Hi Louis Szeto,
So if I want to take trades only at the close of each 5 minute bar how would I go about that?
Jacob Barbee
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!