Update docs to include underwaterplot

This commit is contained in:
Matthias 2022-01-01 16:40:18 +01:00
parent fb06a673e0
commit 08ba5b0451
4 changed files with 9 additions and 3 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 KiB

After

Width:  |  Height:  |  Size: 143 KiB

View File

@ -284,6 +284,7 @@ The `plot-profit` subcommand shows an interactive graph with three plots:
Note that this is not the real-world profit, but more of an estimate.
* Profit for each individual pair.
* Parallelism of trades.
* Underwater (Periods of drawdown).
The first graph is good to get a grip of how the overall market progresses.

View File

@ -197,6 +197,9 @@ def add_underwater(fig, row, trades: pd.DataFrame) -> make_subplots:
x=underwater['date'],
y=underwater['drawdown'],
name="Underwater Plot",
fill='tozeroy',
fillcolor='#cc362b',
line={'color': '#cc362b'},
)
fig.add_trace(underwater, row, 1)
except ValueError:
@ -211,10 +214,13 @@ def add_parallelism(fig, row, trades: pd.DataFrame, timeframe: str) -> make_subp
try:
result = analyze_trade_parallelism(trades, timeframe)
drawdown = go.Bar(
drawdown = go.Scatter(
x=result.index,
y=result['open_trades'],
name="Parallel trades",
fill='tozeroy',
fillcolor='#242222',
line={'color': '#242222'},
)
fig.add_trace(drawdown, row, 1)
except ValueError:
@ -520,7 +526,6 @@ def generate_profit_graph(pairs: str, data: Dict[str, pd.DataFrame],
)
fig = make_subplots(rows=5, cols=1, shared_xaxes=True,
row_width=[1, 1, 1, 1, 1],
row_heights=[1, 1, 1, 0.5, 1],
vertical_spacing=0.05,
subplot_titles=[

View File

@ -346,7 +346,7 @@ def test_generate_profit_graph(testdatadir):
drawdown = find_trace_in_fig_data(figure.data, "Max drawdown 10.45%")
assert isinstance(drawdown, go.Scatter)
parallel = find_trace_in_fig_data(figure.data, "Parallel trades")
assert isinstance(parallel, go.Bar)
assert isinstance(parallel, go.Scatter)
underwater = find_trace_in_fig_data(figure.data, "Underwater Plot")
assert isinstance(underwater, go.Scatter)