Don't load trades twice ...

This commit is contained in:
Matthias
2019-11-13 20:44:55 +01:00
parent 17c11b2afa
commit c8c48156dd
2 changed files with 9 additions and 8 deletions

View File

@@ -47,7 +47,7 @@ def init_plotscript(config):
db_url=config.get('db_url'),
exportfilename=config.get('exportfilename'),
)
trades = history.trim_dataframe(trades, timerange, 'open_time')
return {"tickers": tickers,
"trades": trades,
"pairs": pairs,
@@ -377,10 +377,7 @@ def plot_profit(config: Dict[str, Any]) -> None:
in helping out to find a good algorithm.
"""
plot_elements = init_plotscript(config)
trades = load_trades(config['trade_source'],
db_url=str(config.get('db_url')),
exportfilename=str(config.get('exportfilename')),
)
trades = plot_elements['trades']
# Filter trades to relevant pairs
trades = trades[trades['pair'].isin(plot_elements["pairs"])]
# Create an average close price of all the pairs that were involved.