Trading, Python, Quantitative Finance, Finance, Investing.
signals['short_mavg'] = prices.rolling(window=short_window, min_periods=1, center=False).mean() # Create long simple moving average signals['long_mavg'] = prices.rolling(window=long_window, min_periods=1, center=False).mean() # Create signals signals['signal'][short_window:] =