Machine Learning, Investment, AI, Sklearn, Quant.
dataset['Close'].rolling(window=10, min_periods=1, center=False).mean() # Create long simple moving average over the long window dataset['long_mavg'] = dataset['Close'].rolling(window=60, min_periods=1, center=False).mean() # Create signals dataset['Sign_1'] = (np.where(dataset['short_mavg'] >