add max_buy_position_adjustment as attribute

This commit is contained in:
Stefano Ariestasia
2022-01-19 16:50:13 +09:00
parent 301b2e8a0f
commit 5525fdae1a
4 changed files with 7 additions and 3 deletions

View File

@@ -97,7 +97,8 @@ class StrategyResolver(IResolver):
("sell_profit_offset", 0.0),
("disable_dataframe_checks", False),
("ignore_buying_expired_candle_after", 0),
("position_adjustment_enable", False)
("position_adjustment_enable", False),
("max_buy_position_adjustment", 1)
]
for attribute, default in attributes:
StrategyResolver._override_attribute_helper(strategy, config,

View File

@@ -108,6 +108,7 @@ class IStrategy(ABC, HyperStrategyMixin):
# Position adjustment is disabled by default
position_adjustment_enable: bool = False
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