Added min_stake, max_stake. Removed pair as its included in trade.
This commit is contained in:
@@ -384,9 +384,9 @@ class IStrategy(ABC, HyperStrategyMixin):
|
||||
"""
|
||||
return proposed_stake
|
||||
|
||||
def adjust_trade_position(self, pair: str, trade: Trade, current_time: datetime,
|
||||
current_rate: float, current_profit: float, **kwargs
|
||||
) -> Optional[float]:
|
||||
def adjust_trade_position(self, trade: Trade, current_time: datetime,
|
||||
current_rate: float, current_profit: float, min_stake: float,
|
||||
max_stake: float, **kwargs) -> Optional[float]:
|
||||
"""
|
||||
Custom trade adjustment logic, returning the stake amount that a trade should be increased.
|
||||
This means extra buy orders with additional fees.
|
||||
@@ -395,11 +395,12 @@ class IStrategy(ABC, HyperStrategyMixin):
|
||||
|
||||
When not implemented by a strategy, returns None
|
||||
|
||||
:param pair: Pair that's currently analyzed
|
||||
:param trade: trade object.
|
||||
:param current_time: datetime object, containing the current datetime
|
||||
:param current_rate: Current buy rate. Use `exchange.get_rate` if you need sell rate.
|
||||
:param current_rate: Current buy rate.
|
||||
:param current_profit: Current profit (as ratio), calculated based on current_rate.
|
||||
:param min_stake: Minimal stake size allowed by exchange.
|
||||
:param max_stake: Balance available for trading.
|
||||
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
|
||||
:return float: Stake amount to adjust your trade
|
||||
"""
|
||||
|
Reference in New Issue
Block a user