Add can_short to sample strategies
This commit is contained in:
parent
0aa170ac95
commit
12c909d8a8
@ -81,6 +81,7 @@ class IStrategy(ABC, HyperStrategyMixin):
|
|||||||
trailing_only_offset_is_reached = False
|
trailing_only_offset_is_reached = False
|
||||||
use_custom_stoploss: bool = False
|
use_custom_stoploss: bool = False
|
||||||
|
|
||||||
|
# Can this strategy go short?
|
||||||
can_short: bool = False
|
can_short: bool = False
|
||||||
|
|
||||||
# associated timeframe
|
# associated timeframe
|
||||||
|
@ -40,6 +40,9 @@ class {{ strategy }}(IStrategy):
|
|||||||
# Optimal timeframe for the strategy.
|
# Optimal timeframe for the strategy.
|
||||||
timeframe = '5m'
|
timeframe = '5m'
|
||||||
|
|
||||||
|
# Can this strategy go short?
|
||||||
|
can_short: bool = False
|
||||||
|
|
||||||
# Minimal ROI designed for the strategy.
|
# Minimal ROI designed for the strategy.
|
||||||
# This attribute will be overridden if the config file contains "minimal_roi".
|
# This attribute will be overridden if the config file contains "minimal_roi".
|
||||||
minimal_roi = {
|
minimal_roi = {
|
||||||
|
@ -38,6 +38,9 @@ class SampleShortStrategy(IStrategy):
|
|||||||
# Check the documentation or the Sample strategy to get the latest version.
|
# Check the documentation or the Sample strategy to get the latest version.
|
||||||
INTERFACE_VERSION = 2
|
INTERFACE_VERSION = 2
|
||||||
|
|
||||||
|
# Can this strategy go short?
|
||||||
|
can_short: bool = True
|
||||||
|
|
||||||
# Minimal ROI designed for the strategy.
|
# Minimal ROI designed for the strategy.
|
||||||
# This attribute will be overridden if the config file contains "minimal_roi".
|
# This attribute will be overridden if the config file contains "minimal_roi".
|
||||||
minimal_roi = {
|
minimal_roi = {
|
||||||
|
@ -37,6 +37,9 @@ class SampleStrategy(IStrategy):
|
|||||||
# Check the documentation or the Sample strategy to get the latest version.
|
# Check the documentation or the Sample strategy to get the latest version.
|
||||||
INTERFACE_VERSION = 2
|
INTERFACE_VERSION = 2
|
||||||
|
|
||||||
|
# Can this strategy go short?
|
||||||
|
can_short: bool = False
|
||||||
|
|
||||||
# Minimal ROI designed for the strategy.
|
# Minimal ROI designed for the strategy.
|
||||||
# This attribute will be overridden if the config file contains "minimal_roi".
|
# This attribute will be overridden if the config file contains "minimal_roi".
|
||||||
minimal_roi = {
|
minimal_roi = {
|
||||||
@ -55,12 +58,6 @@ class SampleStrategy(IStrategy):
|
|||||||
# trailing_stop_positive = 0.01
|
# trailing_stop_positive = 0.01
|
||||||
# trailing_stop_positive_offset = 0.0 # Disabled / not configured
|
# trailing_stop_positive_offset = 0.0 # Disabled / not configured
|
||||||
|
|
||||||
# Hyperoptable parameters
|
|
||||||
buy_rsi = IntParameter(low=1, high=50, default=30, space='buy', optimize=True, load=True)
|
|
||||||
sell_rsi = IntParameter(low=50, high=100, default=70, space='sell', optimize=True, load=True)
|
|
||||||
short_rsi = IntParameter(low=51, high=100, default=70, space='sell', optimize=True, load=True)
|
|
||||||
exit_short_rsi = IntParameter(low=1, high=50, default=30, space='buy', optimize=True, load=True)
|
|
||||||
|
|
||||||
# Optimal timeframe for the strategy.
|
# Optimal timeframe for the strategy.
|
||||||
timeframe = '5m'
|
timeframe = '5m'
|
||||||
|
|
||||||
@ -72,6 +69,12 @@ class SampleStrategy(IStrategy):
|
|||||||
sell_profit_only = False
|
sell_profit_only = False
|
||||||
ignore_roi_if_buy_signal = False
|
ignore_roi_if_buy_signal = False
|
||||||
|
|
||||||
|
# Hyperoptable parameters
|
||||||
|
buy_rsi = IntParameter(low=1, high=50, default=30, space='buy', optimize=True, load=True)
|
||||||
|
sell_rsi = IntParameter(low=50, high=100, default=70, space='sell', optimize=True, load=True)
|
||||||
|
short_rsi = IntParameter(low=51, high=100, default=70, space='sell', optimize=True, load=True)
|
||||||
|
exit_short_rsi = IntParameter(low=1, high=50, default=30, space='buy', optimize=True, load=True)
|
||||||
|
|
||||||
# Number of candles the strategy requires before producing valid signals
|
# Number of candles the strategy requires before producing valid signals
|
||||||
startup_candle_count: int = 30
|
startup_candle_count: int = 30
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user