Skip to content

Commit b3b3bf6

Browse files
committed
feat: allow break-even (0.0) as valid return from custom_roi
1 parent 90e2935 commit b3b3bf6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

freqtrade/strategy/interface.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1681,6 +1681,7 @@ def min_roi_reached_entry(
16811681
"""
16821682

16831683
# Get custom ROI if use_custom_roi is set to True
1684+
custom_roi = None
16841685
if self.use_custom_roi:
16851686
custom_roi = strategy_safe_wrapper(
16861687
self.custom_roi, default_retval=None, supress_error=True
@@ -1692,11 +1693,9 @@ def min_roi_reached_entry(
16921693
entry_tag=trade.enter_tag,
16931694
side=trade.trade_direction,
16941695
)
1695-
if not custom_roi or isnan(custom_roi) or isinf(custom_roi):
1696+
if custom_roi is None or isnan(custom_roi) or isinf(custom_roi):
16961697
custom_roi = None
16971698
logger.debug(f"Custom ROI function did not return a valid ROI for {trade.pair}")
1698-
else:
1699-
custom_roi = None
17001699

17011700
# Get highest entry in ROI dict where key <= trade-duration
17021701
roi_list = [x for x in self.minimal_roi.keys() if x <= trade_dur]

0 commit comments

Comments
 (0)