This commit is contained in:
hroff-1902 2019-06-20 03:26:25 +03:00
parent a8efb1e1c8
commit 144e053a4e

View File

@ -357,13 +357,13 @@ class IStrategy(ABC):
# Check if time matches and current rate is above threshold
trade_dur = (current_time.timestamp() - trade.open_date.timestamp()) / 60
# Get highest entry in ROI dict where key >= trade-duration
roi_entry = max(list(filter(lambda x: trade_dur >= x, self.minimal_roi.keys())))
threshold = self.minimal_roi[roi_entry]
if current_profit > threshold:
return True
# Get highest entry in ROI dict where key <= trade-duration
roi_list = list(filter(lambda x: x <= trade_dur, self.minimal_roi.keys()))
if not roi_list:
return False
roi_entry = max(roi_list)
threshold = self.minimal_roi[roi_entry]
return current_profit > threshold
def tickerdata_to_dataframe(self, tickerdata: Dict[str, List]) -> Dict[str, DataFrame]:
"""