Stock Exchange for python programmers by Vieira Rodrigues Paulo Leonardo

Stock Exchange for python programmers by Vieira Rodrigues Paulo Leonardo

Author:Vieira Rodrigues, Paulo Leonardo [Vieira Rodrigues, Paulo Leonardo]
Language: eng
Format: epub
Published: 2020-02-17T16:00:00+00:00


aapl_avg = aapl . Close . rolling(window = window) . mean() . dropna()

aapl_std = aapl . Close . rolling(window = window) . std() . dropna()

With the basic data calculated, we can build the final dataframe for Bollinger Bands values. This dataframe consist of values for the upper band, the lower band and the middle band.

aapl_bollinger = pd . DataFrame(index = aapl_avg . index)

aapl_bollinger[ 'mband' ] = aapl_avg

aapl_bollinger[ 'uband' ] = aapl_avg + aapl_std . apply( lambda x: (x * 2 ))

aapl_bollinger[ 'lband' ] = aapl_avg - aapl_std . apply( lambda x: (x * 2 ))



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.