def sma(prices, n=20):
    """ Calculate simple moving average of one stock using rolling mean
    Params:
    @prices: price data of stock with dates as index
    @n: number of days in smoothing period (typically 20)

    Return:
    @moving_avg: Moving average price of the stock
    """
    moving_avg = prices.rolling(window=n).mean()
    return moving_avg