-
-
Save quantra-go-algo/f6cd26b16296085f569ef3f96ac214e1 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
# Generate signals based on moving average crossover | |
aapl_data['Signal'] = 0 # 0 indicates no signal | |
aapl_data.loc[aapl_data['SMA_50'] > aapl_data['SMA_200'], 'Signal'] = 1 # 1 indicates buy signal | |
aapl_data.loc[aapl_data['SMA_50'] < aapl_data['SMA_200'], 'Signal'] = -1 # -1 indicates sell signal |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment