Refactoring to use strategy based configuration

This commit is contained in:
Reigo Reinmets
2021-12-24 12:38:43 +02:00
parent ac690e9215
commit de79d25caf
13 changed files with 117 additions and 200 deletions

View File

@@ -6,6 +6,7 @@ import talib.abstract as ta
from pandas import DataFrame
import freqtrade.vendor.qtpylib.indicators as qtpylib
from freqtrade.exceptions import DependencyException
from freqtrade.persistence import Trade
from freqtrade.strategy.interface import IStrategy
@@ -51,6 +52,9 @@ class StrategyTestV2(IStrategy):
'sell': 'gtc',
}
# By default this strategy does not use Position Adjustments
position_adjustment_enable = False
def informative_pairs(self):
"""
Define additional, informative pair/interval combinations to be cached from the exchange.
@@ -162,10 +166,9 @@ class StrategyTestV2(IStrategy):
current_rate: float, current_profit: float, **kwargs):
if current_profit < -0.0075:
for order in trade.orders:
if order.ft_is_open:
return None
return self.wallets.get_trade_stake_amount(pair, None)
try:
return self.wallets.get_trade_stake_amount(pair, None)
except DependencyException:
pass
return None