Align backtest to interface.py

interface.py roi calculation skips on <= duration
the correct selection is therefore trade_duration > x.
This commit is contained in:
Matthias 2019-01-01 16:50:10 +01:00
parent 1d518885a9
commit 2bc76771bf

View File

@ -219,8 +219,9 @@ class Backtesting(object):
# Set close_rate to stoploss
closerate = trade.stop_loss
elif sell.sell_type == (SellType.ROI):
# get entry in min_roi >= to trade duration
roi_entry = max(list(filter(lambda x: trade_dur >= x,
# get next entry in min_roi > to trade duration
# Interface.py skips on trade_duration <= duration
roi_entry = max(list(filter(lambda x: trade_dur > x,
self.strategy.minimal_roi.keys())))
roi = self.strategy.minimal_roi[roi_entry]