Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
StdDev

Is it possible to create a new figure for the Standard deviation from VWAP itself? If so, does someone have that?

7 responses

that is- based on minute data and a VWAP that resets daily...

Hello Justin,

The code you need should be straightforward, but I don't understand the requirements yet. For trading on day 0, are you only interested in data from day 0? Or are you looking to use data from day -1 for trading on day 0? Or perhaps "resets daily" means that you want to use a trailing window, of fixed length (e.g. 390 minutes), that is continuously updated every minute?

Grant

Grant,
First of all thank you for your reply-

Secondly, so the standard deviation of VWAP would start aggregating in the 0th minute of the trading day to the 390th then reset each day. So no I am not looking at day -1 at all --

Tell me if this makes sense

Justin,

O.K. The issue I see is that you'll start with only one data point, so there will be no way to compute the standard deviation. By the end of the day, you'll have 390 points, which is sufficient. Are you considering using the standard deviation of the VWAP to make a trading decision for every minute of the day? If so, it'll be a pretty sketchy estimate until you get beyond the first portion of the day.

Grant

I am wondering about this myself. I currently I have a py script using a imports csv to a dataframe and calculates VWAP and its standard deviation specific to each day. I don't seem to understand how to port this to Quantopian since it uses dataframe manipultation and expanding_std to get there.
My dataframe uses groupby functions to reset vwap at the beginning of each trading day and I am a little lost how to do it here.

BTW, I am just learning python and coding in general.
Any suggestions on how to do this would be great.

Josh,

Are you looking for an example of how to code VWAP using Quantopian bar data, or data you import using fetcher?

GRant

I dont think it's exactly what you are looking for, but I have a class that keeps a trailing list of vwap values. You can probably extend it to support what you are looking to do.