New to quantopian, how would I go about creating standard deviation bars for the VWAP?
Thanks
New to quantopian, how would I go about creating standard deviation bars for the VWAP?
Thanks
Do you want the code or logic ?
Logic: I think it's simple. Just like Bollinger Bands. Check if there is a built-in func, to find the std dev. It would probably take the input - Vwap, Close, period.
I found this:
from statistics import stdev
import statistics
sample = (1, 1.3, 1.2, 1.9, 2.5, 2.2)
m = statistics.mean(sample)
print("Standard Deviation of Sample set is % s"
%(statistics.stdev(sample, xbar = m)))
Now sample would be the rolling close price. (just like moving avg)
M = vwap of the sample