def f_sma(close_prices, window):
    """Calculates standard moving average SMA).

    This function takes historical data, and a moving window to calculate SMA.
    As the moving average takes previous closing prices into account, its length will be len(candles) - window

    Args:
        close_prices (list of float): A list of close prices for each period.
        window (int): The moving window to take averages over.

    Returns:
        list of float: A list of SMAs
    """
    sma = []
    i = 0
    n = len(close_prices) - window + 1

    for i in range(n):
        sma.append(sum(close_prices[i:i+window])/window)
        i += 1

    return sma