I would like to make the peaks turn red and the dips turn green. The markers work but the lines do not. What am I missing?
WillR10
fig.add_trace(
go.Scatter(
yaxis='y1',
x=df_ohlc.index,
y=df_ohlc['WillR10'],
name='WillR10',
line={
'color': 'white',
'dash': 'dot', # "solid", "dot", "dash", "longdash", "dashdot", or "longdashdot"
},
mode='lines+markers', # "lines+markers+text"
# opacity=0.6,
marker={
'cmin': 0,
'cmax': 1,
'cmid': 0.5,
'color': df_ohlc['WillR10'],
'colorscale': [
# bottom 10% green
[0, 'rgba(0, 255, 0, 255)'],
[0.1, 'rgba(0, 255, 0, 255)'],
# mid 80% grey
[0.1, 'rgba(128, 128, 128, 0)'],
[0.9, 'rgba(128, 128, 128, 0)'],
# top 10% red
[0.9, 'rgba(255, 0, 0, 255)'],
[1.0, 'rgba(255, 0, 0, 255)'],
],
# https://plotly.com/python/reference/scatter/#scatter-marker-line
'line': {
'cmax': 1,
'cmin': 0,
'cmid': 0.5,
'color': df_ohlc['WillR10'],
'colorscale': [
# bottom 10% green
[0, 'rgba(0, 255, 0, 255)'],
[0.1, 'rgba(0, 255, 0, 255)'],
# mid 80% grey
[0.1, 'rgba(128, 128, 128, 0)'],
[0.9, 'rgba(128, 128, 128, 0)'],
# top 10% red
[0.9, 'rgba(255, 0, 0, 255)'],
[1.0, 'rgba(255, 0, 0, 255)'],
]
}
},
)
)