ruff format: Update test strategies

This commit is contained in:
Matthias
2024-05-12 15:41:07 +02:00
parent 099b1fc8c4
commit 8c7d80b78e
23 changed files with 420 additions and 462 deletions
@@ -15,20 +15,22 @@ class HyperoptableStrategyV2(StrategyTestV2):
"""
buy_params = {
'buy_rsi': 35,
"buy_rsi": 35,
# Intentionally not specified, so "default" is tested
# 'buy_plusdi': 0.4
}
sell_params = {
'sell_rsi': 74,
'sell_minusdi': 0.4
# Sell parameters
"sell_rsi": 74,
"sell_minusdi": 0.4,
}
buy_plusdi = RealParameter(low=0, high=1, default=0.5, space='buy')
sell_rsi = IntParameter(low=50, high=100, default=70, space='sell')
sell_minusdi = DecimalParameter(low=0, high=1, default=0.5001, decimals=3, space='sell',
load=False)
buy_plusdi = RealParameter(low=0, high=1, default=0.5, space="buy")
sell_rsi = IntParameter(low=50, high=100, default=70, space="sell")
sell_minusdi = DecimalParameter(
low=0, high=1, default=0.5001, decimals=3, space="sell", load=False
)
protection_enabled = BooleanParameter(default=True)
protection_cooldown_lookback = IntParameter([0, 50], default=30)
@@ -36,10 +38,12 @@ class HyperoptableStrategyV2(StrategyTestV2):
def protections(self):
prot = []
if self.protection_enabled.value:
prot.append({
"method": "CooldownPeriod",
"stop_duration_candles": self.protection_cooldown_lookback.value
})
prot.append(
{
"method": "CooldownPeriod",
"stop_duration_candles": self.protection_cooldown_lookback.value,
}
)
return prot
bot_loop_started = False
@@ -51,4 +55,4 @@ class HyperoptableStrategyV2(StrategyTestV2):
"""
Parameters can also be defined here ...
"""
self.buy_rsi = IntParameter([0, 50], default=30, space='buy')
self.buy_rsi = IntParameter([0, 50], default=30, space="buy")