Originally I had tried to implement this logic using the ATR indicator with a period of one and a 10 minute consolidator, giving me a true range, but from what I could gather, it was updating every minute, so I was not actually receiving a 10 minute range. Anyways, I have tried to just create the values myself by subtracting the high from the low of a trade bar, then performing a std deviation calculation on that list, but something is clearly wrong, and I have looked at it 1000 times and can't find the answer.
In short, what I want to have is a list containing 39 values (390 minutes in session/10 minutes) representing the price difference of the high and low for a given security in that ten minute consolidated bar. For example, if stock x opens at 9:30 at 100$, then at 9:35 it reaches high 101$, then closes at 9:39:59 at 100.50, 101high -100low = 1$, then 38 more times.
So ultimately, I can perform this calculation
2 * (np.std[1.00, 1.27, 0.54, 0.75, etc…………………….…..])
I have commented the lines of code which are important/where the problem is likely located.
Thanks
Victoria Butler
It seems for some reason, when I debug, that the value is NaN, which I don't see why.
Vladimir
Victoria Butler
You can try to get the standard deviation of the difference between the high and low as follows.
If you are satisfied with my answer, please accept it and don't forget to like it.
Vladimir
Victoria Butler
If you normalize the standard deviation to price, you might find that AMD's normalized high-low difference volatility is twice that of AAPL or TSLA, and four times that of MSFT.
If you are satisfied with my answer, please don't forget to like it.
Vladimir
Victoria Butler
Here is Normalized Standard Deviation of High Low Difference on 30 minutes consolidated bar.
Victoria Butler
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!