Update swing trading dashboard and High Volume Days strategy following changes to OHLC data volume column

This commit is contained in:
moshferatu 2024-11-22 11:46:47 -08:00
parent 8d9121d02a
commit 6247bb48aa
2 changed files with 3 additions and 4 deletions

View File

@ -22,7 +22,7 @@ def get_daily_data(symbol: str, start_date: datetime = datetime.today() - timede
high_price = intraday_data['High'].max()
low_price = intraday_data['Low'].min()
close_price = intraday_data['Close'].iloc[-1]
total_volume = intraday_data['Total Volume'].iloc[-1]
volume = intraday_data['Volume'].sum()
todays_data = {
'Date': today,
@ -30,8 +30,7 @@ def get_daily_data(symbol: str, start_date: datetime = datetime.today() - timede
'High': high_price,
'Low': low_price,
'Close': close_price,
'Total Volume': total_volume,
'Period Volume': 0
'Volume': volume
}
daily_data = concat([daily_data, DataFrame([todays_data])], ignore_index = True)

View File

@ -9,7 +9,7 @@ def signals(data: DataFrame) -> Series:
data['200_MA'] = data['Close'].rolling(window = 200).mean()
above_200_ma = data['Close'] > data['200_MA']
highest_volume = data['Total Volume'] == data['Total Volume'].rolling(window = 5).max()
highest_volume = data['Volume'] == data['Volume'].rolling(window = 5).max()
close_lower_than_open = data['Close'] < data['Open']
signal_condition = above_200_ma & highest_volume & close_lower_than_open