Merge pull request #1131 from freqtrade/parametrize_outdated_ticker

parametrize outdated_offset to simplify sandbox usage
This commit is contained in:
Samuel Husso
2018-08-22 07:02:38 +03:00
committed by GitHub
4 changed files with 61 additions and 68 deletions

View File

@@ -145,7 +145,8 @@ CONF_SCHEMA = {
'pattern': '^[0-9A-Z]+/[0-9A-Z]+$'
},
'uniqueItems': True
}
},
'outdated_offset': {'type': 'integer', 'minimum': 1}
},
'required': ['name', 'key', 'secret', 'pair_whitelist']
}

View File

@@ -155,7 +155,8 @@ class IStrategy(ABC):
# Check if dataframe is out of date
signal_date = arrow.get(latest['date'])
interval_minutes = constants.TICKER_INTERVAL_MINUTES[interval]
if signal_date < (arrow.utcnow().shift(minutes=-(interval_minutes * 2 + 5))):
offset = self.config.get('exchange', {}).get('outdated_offset', 5)
if signal_date < (arrow.utcnow().shift(minutes=-(interval_minutes * 2 + offset))):
logger.warning(
'Outdated history for pair %s. Last tick is %s minutes old',
pair,