Filter open trades - they are not added to the profit calc

This commit is contained in:
Matthias 2019-11-13 20:45:16 +01:00
parent c8c48156dd
commit 38243c52fd

View File

@ -379,7 +379,12 @@ def plot_profit(config: Dict[str, Any]) -> None:
plot_elements = init_plotscript(config)
trades = plot_elements['trades']
# Filter trades to relevant pairs
trades = trades[trades['pair'].isin(plot_elements["pairs"])]
# Remove open pairs - we don't know the profit yet so can't calculate profit for these.
# Also, If only one open pair is left, then the profit-generation would fail.
trades = trades[(trades['pair'].isin(plot_elements["pairs"]))
& (~trades['close_time'].isnull())
]
# Create an average close price of all the pairs that were involved.
# this could be useful to gauge the overall market trend
fig = generate_profit_graph(plot_elements["pairs"], plot_elements["tickers"],