label for fill_area added and documentation updated

This commit is contained in:
Christof 2020-05-17 12:43:38 +02:00
parent ecadfdd98e
commit 3fdfc06a1e
2 changed files with 10 additions and 3 deletions

View File

@ -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,7 +195,13 @@ 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)',
},
}
}
```

View File

@ -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)'},