Hi, I am trying to store 52 week high/low values for the stocks in my algorithm with the help of Minimum/Maximum Indicator classes and populating it manually with 253 data period points. Values are being populated, but they are not the actual 52 week lows when I check them on other sites like tradingview. Please find the backtest along with the code I have shared here.
For easier debugging I have returned GME as the only security. I am getting wrong 52 week low values when we check the console Debug messages. For example on 2020-11-03:
52 week low is shown as 3.85, which is clearly not the case when we check it on Trading view:
Can you please help me by pointing out where am I going wrong? One point I would like to add is even so extensive the Quant Connect platform is, it is extremely time consuming and frustrating to debug the algorithms. I have already spent x3 more time debugging this issue than I spent to actually code it. Thanks in advance.
Vladimir
Log Up
We don't think your code is applied correctly.
Try this way.
If you are satisfied with my answer, please accept it and don't forget to like it.
Log Up
Hi Vladimir Thanks for the answer. Can you please help and point out why my code is not working/correct?
Thanks in advance.
Vladimir
Log Up
--> Can you please point out why my code is not working correctly?
In your algorithm, instead of calculating Highest High and Lowest Low the code calculates Highest Close and Lowest Close.
You defined the topic of this thread as "Incorrect Minimum indicator value".
If my algorithm calculates Lowest Low correctly please accept my answer.
I'll be happy to answer other questions in another thread.
Log Up
HI Vladimir yes I am aware its not calculating lowest low for 52 week low, I am trying to first model intentional behavior and then will work on fixing data issues. If you check the above chart I posted, the close value also is not expected as 253 period lowest close. your indicator does calculate the correct value, but I am wondering about what is the bug in my code due to which lowest close is not correct.
Log Up
Vladimir Please refer to this chart, The algorithm Minimum is giving 3.85 close as lowest close while we have 2.80 which is lower close than it.
Vladimir
Log Up
Try to calculate Highest Close and Lowest Close using self.MAX() and self.MIN()
2020-11-03 Lowest Close = 2.795
If you are satisfied with my answer, please accept it and don't forget to like it.
Log Up
Vladimir MIN() is readily available and automatic updated version for Minimum Indicator class right? Why might Minimum not be working?
Vladimir
Log Up
Using Maximum() and Minimum() return the same results.
2020-11-03 Lowest Close = 2.795
If you are satisfied with my answer, please accept it and don't forget to like it.
Log Up
Vladimir yes, Will be thankful to you if you could help me out on what is going wrong in my algorithm when I am trying to achieve it with CoarseSelectionFunction.
Vladimir
Log Up
You defined the topic of this thread as "Incorrect Minimum indicator value".
If my algorithm calculates Lowest Close correctly please accept my answer.
I'll be happy to answer other questions in another thread.
Log Up
Vladimir sure, created new discussion:
Log Up
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!