stocksignals.calc_moving_avg¶
Module Contents¶
Functions¶
|
Calculates the moving average of a stock price for a given range of dates |
- stocksignals.calc_moving_avg.moving_average(stock_data, size)¶
Calculates the moving average of a stock price for a given range of dates
- Parameters:
stock_data (string) – A string corresponding to the name of the stock.
size (int) – The size of the period that we’re interested in.
- Returns:
moving_avg – A dataframe representing the 200 day moving average, for example, of a stock price.
- Return type:
dataframe
Examples
>>> moving_average("MSFT", 200)