diff --git a/docs/strategy-customization.md b/docs/strategy-customization.md index e344c1b7d..3a8425b4e 100644 --- a/docs/strategy-customization.md +++ b/docs/strategy-customization.md @@ -35,7 +35,7 @@ The bot also include a sample strategy called `SampleStrategy` you can update: ` You can test it with the parameter: `--strategy SampleStrategy` Additionally, there is an attribute called `INTERFACE_VERSION`, which defines the version of the strategy interface the bot should use. -The current version is 2 - which is also the default when it's not set explicitly in the strategy. +The current version is 3 - which is also the default when it's not set explicitly in the strategy. Future versions will require this to be set. diff --git a/docs/strategy_migration.md b/docs/strategy_migration.md index d2614444a..9f0300fe3 100644 --- a/docs/strategy_migration.md +++ b/docs/strategy_migration.md @@ -20,6 +20,7 @@ If you intend on using markets other than spot markets, please migrate your stra * Introduced new `leverage` callback * `@informative` decorator now takes an optional `candle_type` argument * helper methods `stoploss_from_open` and `stoploss_from_absolute` now take `is_short` as additional argument. +* `INTERFACE_VERSION` should be set to 3. ## Extensive explanation diff --git a/freqtrade/strategy/interface.py b/freqtrade/strategy/interface.py index 3fddc98df..c759d50de 100644 --- a/freqtrade/strategy/interface.py +++ b/freqtrade/strategy/interface.py @@ -62,7 +62,8 @@ class IStrategy(ABC, HyperStrategyMixin): # Default to version 2 # Version 1 is the initial interface without metadata dict # Version 2 populate_* include metadata dict - INTERFACE_VERSION: int = 2 + # Version 3 - First version with short and leverage support + INTERFACE_VERSION: int = 3 _populate_fun_len: int = 0 _buy_fun_len: int = 0 diff --git a/freqtrade/templates/base_strategy.py.j2 b/freqtrade/templates/base_strategy.py.j2 index ef8f46f5c..78ee8572e 100644 --- a/freqtrade/templates/base_strategy.py.j2 +++ b/freqtrade/templates/base_strategy.py.j2 @@ -35,7 +35,7 @@ class {{ strategy }}(IStrategy): """ # Strategy interface version - allow new iterations of the strategy interface. # Check the documentation or the Sample strategy to get the latest version. - INTERFACE_VERSION = 2 + INTERFACE_VERSION = 3 # Optimal timeframe for the strategy. timeframe = '5m' diff --git a/freqtrade/templates/sample_short_strategy.py b/freqtrade/templates/sample_short_strategy.py index 1dfd1df0d..6be46430b 100644 --- a/freqtrade/templates/sample_short_strategy.py +++ b/freqtrade/templates/sample_short_strategy.py @@ -36,7 +36,7 @@ class SampleShortStrategy(IStrategy): """ # Strategy interface version - allow new iterations of the strategy interface. # Check the documentation or the Sample strategy to get the latest version. - INTERFACE_VERSION = 2 + INTERFACE_VERSION = 3 # Can this strategy go short? can_short: bool = True diff --git a/freqtrade/templates/sample_strategy.py b/freqtrade/templates/sample_strategy.py index fe1bd22fb..08a690ab0 100644 --- a/freqtrade/templates/sample_strategy.py +++ b/freqtrade/templates/sample_strategy.py @@ -35,7 +35,7 @@ class SampleStrategy(IStrategy): """ # Strategy interface version - allow new iterations of the strategy interface. # Check the documentation or the Sample strategy to get the latest version. - INTERFACE_VERSION = 2 + INTERFACE_VERSION = 3 # Can this strategy go short? can_short: bool = False