(feat) clean up visualization

This commit is contained in:
cardosofede
2024-05-21 12:04:20 -05:00
parent b865eb175c
commit d2f4a9ee6a
2 changed files with 1 additions and 2 deletions

View File

@@ -5,7 +5,6 @@ from frontend.visualization import theme
def get_candlestick_trace(df): def get_candlestick_trace(df):
df.index = pd.to_datetime(df.timestamp, unit='ms')
return go.Candlestick(x=df.index, return go.Candlestick(x=df.index,
open=df['open'], open=df['open'],
high=df['high'], high=df['high'],

View File

@@ -40,4 +40,4 @@ def get_macd_traces(df, macd_fast, macd_slow, macd_signal):
go.Bar(x=df.index, y=df[macd_hist], name='MACD Histogram', go.Bar(x=df.index, y=df[macd_hist], name='MACD Histogram',
marker_color=df[f"MACDh_{macd_fast}_{macd_slow}_{macd_signal}"].apply(lambda x: '#FF6347' if x < 0 else '#32CD32')) marker_color=df[f"MACDh_{macd_fast}_{macd_slow}_{macd_signal}"].apply(lambda x: '#FF6347' if x < 0 else '#32CD32'))
] ]
return traces return traces