Refactoring to use strategy based configuration
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user