create compatibility code
This commit is contained in:
@@ -50,6 +50,14 @@ class StrategyResolver(IResolver):
|
||||
if 'ask_strategy' not in config:
|
||||
config['ask_strategy'] = {}
|
||||
|
||||
if hasattr(strategy, 'ticker_interval') and not hasattr(strategy, 'timeframe'):
|
||||
# Assign ticker_interval to timeframe to keep compatibility
|
||||
if 'timeframe' not in config:
|
||||
logger.warning(
|
||||
"DEPRECATED: Please migrate to using timeframe instead of ticker_interval."
|
||||
)
|
||||
strategy.timeframe = strategy.ticker_interval
|
||||
|
||||
# Set attributes
|
||||
# Check if we need to override configuration
|
||||
# (Attribute name, default, subkey)
|
||||
@@ -80,6 +88,9 @@ class StrategyResolver(IResolver):
|
||||
StrategyResolver._override_attribute_helper(strategy, config,
|
||||
attribute, default)
|
||||
|
||||
# Assign deprecated variable - to not break users code relying on this.
|
||||
strategy.ticker_interval = strategy.timeframe
|
||||
|
||||
# Loop this list again to have output combined
|
||||
for attribute, _, subkey in attributes:
|
||||
if subkey and attribute in config[subkey]:
|
||||
|
Reference in New Issue
Block a user