perfect charts
This commit is contained in:
parent
6217fd6e1c
commit
9e81e86b1c
@ -1556,13 +1556,16 @@ class RealTimeChart:
|
|||||||
row=1, col=1
|
row=1, col=1
|
||||||
)
|
)
|
||||||
|
|
||||||
# Volume chart
|
# Volume chart - use red/green colors based on price movement
|
||||||
|
colors = ['rgba(0,255,0,0.7)' if close >= open else 'rgba(255,0,0,0.7)'
|
||||||
|
for open, close in zip(df['open'], df['close'])]
|
||||||
|
|
||||||
fig.add_trace(
|
fig.add_trace(
|
||||||
go.Bar(
|
go.Bar(
|
||||||
x=df.index,
|
x=df.index,
|
||||||
y=df['volume'],
|
y=df['volume'],
|
||||||
name='Volume',
|
name='Volume',
|
||||||
marker_color='rgba(0, 0, 255, 0.5)'
|
marker_color=colors
|
||||||
),
|
),
|
||||||
row=2, col=1
|
row=2, col=1
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user