label for fill_area added and documentation updated
This commit is contained in:
parent
ecadfdd98e
commit
3fdfc06a1e
@ -168,6 +168,7 @@ Additional features when using plot_config include:
|
||||
|
||||
* Specify colors per indicator
|
||||
* Specify additional subplots
|
||||
* Specify idicator pairs to fill area in between
|
||||
|
||||
The sample plot configuration below specifies fixed colors for the indicators. Otherwise consecutive plots may produce different colorschemes each time, making comparisons difficult.
|
||||
It also allows multiple subplots to display both MACD and RSI at the same time.
|
||||
@ -194,6 +195,12 @@ Sample configuration with inline comments explaining the process:
|
||||
"RSI": {
|
||||
'rsi': {'color': 'red'},
|
||||
}
|
||||
},
|
||||
'fill_area': {
|
||||
"Ichimoku Cloud": {
|
||||
'traces': ('senkou_a', 'senkou_b'),
|
||||
'color': 'rgba(0,176,246,0.2)',
|
||||
},
|
||||
}
|
||||
}
|
||||
```
|
||||
|
@ -383,7 +383,7 @@ def generate_candlestick_graph(pair: str, data: pd.DataFrame, trades: pd.DataFra
|
||||
|
||||
#fill area betwenn traces i.e. for ichimoku
|
||||
if 'fill_area' in plot_config.keys():
|
||||
for area in plot_config['fill_area']:
|
||||
for label, area in plot_config['fill_area'].items():
|
||||
#!error: need exactly 2 trace
|
||||
traces = area['traces']
|
||||
color = area['color']
|
||||
@ -397,7 +397,7 @@ def generate_candlestick_graph(pair: str, data: pd.DataFrame, trades: pd.DataFra
|
||||
trace_a = go.Scatter(
|
||||
x=data.date,
|
||||
y=data.get(traces[1]),
|
||||
name=f'{traces[0]} * {traces[1]}',
|
||||
name=label,
|
||||
fill="tonexty",
|
||||
fillcolor=color,
|
||||
line={'color': 'rgba(255,255,255,0)'},
|
||||
|
Loading…
Reference in New Issue
Block a user