mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
short circuit check for roi threshold
This commit is contained in:
parent
4760dd699d
commit
bf46f2e50d
|
@ -302,10 +302,12 @@ def min_roi_reached(trade: Trade, current_rate: float, current_time: datetime) -
|
||||||
|
|
||||||
# Check if time matches and current rate is above threshold
|
# Check if time matches and current rate is above threshold
|
||||||
time_diff = (current_time.timestamp() - trade.open_date.timestamp()) / 60
|
time_diff = (current_time.timestamp() - trade.open_date.timestamp()) / 60
|
||||||
for duration, threshold in strategy.minimal_roi.items():
|
for duration_string, threshold in strategy.minimal_roi.items():
|
||||||
if time_diff > float(duration) and current_profit > threshold:
|
duration = float(duration_string)
|
||||||
|
if time_diff > duration and current_profit > threshold:
|
||||||
return True
|
return True
|
||||||
|
if time_diff < duration:
|
||||||
|
return False
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user