def predict_by_moving_avg_growth(stock, s, **_):
    """Returns predicted value of a stock

    Predicts the next price of a stock by extrapolating the moving average and its growth.

    Parameters
    ----------
    stock : :obj:`stock`
        Stock to be predicted.
    s : int
         Number of data points used to calculate a moving average.

    Returns
    -------
    int
        Predicted next price of the stock


    Notes
    _____
    The moving average lags behind by n/2 + 0.5 periods when not centered around the mean.

    """
    stockPriceHistory = len(stock.price_history)
    if stockPriceHistory < s+1:
        return None
    else:
        ma = sum(stock.price_history[-s:]) / s
        growth = ma - sum(stock.price_history[-s-1:-1]) / s
        predicted = ma + (s/2+0.5)*growth
        if predicted > 0:
            return predicted
        else:
            return 0