Have backtest use the same logic to get the ROI entry
This commit is contained in:
parent
e9d61eb35d
commit
cd2bccd441
@ -221,7 +221,7 @@ class Backtesting(object):
|
|||||||
elif sell.sell_type == (SellType.ROI):
|
elif sell.sell_type == (SellType.ROI):
|
||||||
# get next entry in min_roi > to trade duration
|
# get next entry in min_roi > to trade duration
|
||||||
# Interface.py skips on trade_duration <= duration
|
# Interface.py skips on trade_duration <= duration
|
||||||
roi_entry = max(list(filter(lambda x: trade_dur > x,
|
roi_entry = max(list(filter(lambda x: trade_dur >= x,
|
||||||
self.strategy.minimal_roi.keys())))
|
self.strategy.minimal_roi.keys())))
|
||||||
roi = self.strategy.minimal_roi[roi_entry]
|
roi = self.strategy.minimal_roi[roi_entry]
|
||||||
|
|
||||||
|
@ -530,10 +530,10 @@ def test_backtest(default_conf, fee, mocker) -> None:
|
|||||||
'open_time': [Arrow(2018, 1, 29, 18, 40, 0).datetime,
|
'open_time': [Arrow(2018, 1, 29, 18, 40, 0).datetime,
|
||||||
Arrow(2018, 1, 30, 3, 30, 0).datetime],
|
Arrow(2018, 1, 30, 3, 30, 0).datetime],
|
||||||
'close_time': [Arrow(2018, 1, 29, 22, 35, 0).datetime,
|
'close_time': [Arrow(2018, 1, 29, 22, 35, 0).datetime,
|
||||||
Arrow(2018, 1, 30, 4, 15, 0).datetime],
|
Arrow(2018, 1, 30, 4, 10, 0).datetime],
|
||||||
'open_index': [78, 184],
|
'open_index': [78, 184],
|
||||||
'close_index': [125, 193],
|
'close_index': [125, 192],
|
||||||
'trade_duration': [235, 45],
|
'trade_duration': [235, 40],
|
||||||
'open_at_end': [False, False],
|
'open_at_end': [False, False],
|
||||||
'open_rate': [0.104445, 0.10302485],
|
'open_rate': [0.104445, 0.10302485],
|
||||||
'close_rate': [0.104969, 0.103541],
|
'close_rate': [0.104969, 0.103541],
|
||||||
|
Loading…
Reference in New Issue
Block a user