-
-
Save quantra-go-algo/9c725acfe6c242cdcc9e5f6f725c4a7b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Preparing the dataset | |
price_AAPL['H-L'] = price_AAPL['High'] - price_AAPL['Low'] | |
price_AAPL['O-C'] = price_AAPL['Close'] - price_AAPL['Open'] | |
price_AAPL['3day MA'] = price_AAPL['Close'].shift(1).rolling(window = 3).mean() | |
price_AAPL['10day MA'] = price_AAPL['Close'].shift(1).rolling(window = 10).mean() | |
price_AAPL['30day MA'] = price_AAPL['Close'].shift(1).rolling(window = 30).mean() | |
price_AAPL['Std_dev']= price_AAPL['Close'].rolling(5).std() | |
price_AAPL['RSI'] = talib.RSI(price_AAPL['Close'].values, timeperiod = 9) | |
price_AAPL['Williams %R'] = talib.WILLR(dataset['High'].values, price_AAPL['Low'].values, price_AAPL['Close'].values, 7) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment