final
This commit is contained in:
parent
ba596af636
commit
c442913feb
@ -275,6 +275,9 @@ class IStrategy(ABC):
|
|||||||
logger.warning('Empty dataframe for pair %s', pair)
|
logger.warning('Empty dataframe for pair %s', pair)
|
||||||
return False, False
|
return False, False
|
||||||
|
|
||||||
|
latest = dataframe.iloc[-1]
|
||||||
|
signal_date = arrow.get(latest['date'])
|
||||||
|
|
||||||
# Check if dataframe is out of date
|
# Check if dataframe is out of date
|
||||||
offset = self.config.get('exchange', {}).get('outdated_offset', 5)
|
offset = self.config.get('exchange', {}).get('outdated_offset', 5)
|
||||||
if signal_date < (arrow.utcnow().shift(minutes=-(interval_minutes * 2 + offset))):
|
if signal_date < (arrow.utcnow().shift(minutes=-(interval_minutes * 2 + offset))):
|
||||||
@ -286,8 +289,6 @@ class IStrategy(ABC):
|
|||||||
return False, False
|
return False, False
|
||||||
|
|
||||||
# Check if dataframe has new candle
|
# Check if dataframe has new candle
|
||||||
latest = dataframe.iloc[-1]
|
|
||||||
signal_date = arrow.get(latest['date'])
|
|
||||||
interval_minutes = timeframe_to_minutes(interval)
|
interval_minutes = timeframe_to_minutes(interval)
|
||||||
if (arrow.utcnow() - signal_date).total_seconds() // 60 >= interval_minutes:
|
if (arrow.utcnow() - signal_date).total_seconds() // 60 >= interval_minutes:
|
||||||
logger.warning('Old candle for pair %s. Last candle is %s minutes old',
|
logger.warning('Old candle for pair %s. Last candle is %s minutes old',
|
||||||
|
Loading…
Reference in New Issue
Block a user