Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Std Dev of Price Difference - How to ?

Hello together,

Unfortunately I'm new to Python and Quantopian, and I'm currently struggling with following problem:

How can I calculate the standard deviation for the price difference (in %) over let's say 50 days?

standard_dev = context.diff_perc.stddev(context.period)  

That was my unsuccessful try.

THX 4 your help
Peter

2 responses

Maybe history(50,'1d','price').pct_change().std()

That's from memory, not in front of a computer right now.

THX Simon, it works !