Created
February 17, 2018 23:36
-
-
Save alexbrillant/c533c18bf311d8dedd75dc75c657af28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mean = self.get_simple_moving_average(day) | |
derivations = [price - mean for price in self.prices[-day:]] | |
squared_deviations = [numpy.square(derivation) for derivation in derivations] | |
sum_squared_deviations = sum(squared_deviations) | |
return numpy.sqrt(sum_squared_deviations / day) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment