update
This commit is contained in:
@@ -473,6 +473,16 @@ class FreqtradeBot(LoggingMixin):
|
||||
If the strategy triggers the adjustment, a new order gets issued.
|
||||
Once that completes, the existing trade is modified to match new data.
|
||||
"""
|
||||
if self.strategy.max_buy_position_adjustment > -1:
|
||||
logger.info(f"Max adjustment buy is set to {self.strategy.max_buy_position_adsjutment}.")
|
||||
|
||||
filled_buys = trade.select_filled_orders('buy')
|
||||
count_of_buys = len(filled_buys)
|
||||
if count_of_buys > self.strategy.max_buy_position_adjustment:
|
||||
logger.info(f"Max adjustment buy for {trade.pair} has been reached.")
|
||||
return
|
||||
else:
|
||||
logger.info(f"Max adjustment buy is set to unlimited.")
|
||||
current_rate = self.exchange.get_rate(trade.pair, refresh=True, side="buy")
|
||||
current_profit = trade.calc_profit_ratio(current_rate)
|
||||
|
||||
|
@@ -108,7 +108,7 @@ class IStrategy(ABC, HyperStrategyMixin):
|
||||
|
||||
# Position adjustment is disabled by default
|
||||
position_adjustment_enable: bool = False
|
||||
max_buy_position_adjustment: int = 1
|
||||
max_buy_position_adjustment: int = -1
|
||||
|
||||
# Number of seconds after which the candle will no longer result in a buy on expired candles
|
||||
ignore_buying_expired_candle_after: int = 0
|
||||
|
Reference in New Issue
Block a user