Add stoplossvalue interface
This commit is contained in:
parent
b9f3410d8b
commit
768a24c375
@ -8,6 +8,11 @@ If you're just getting started, please be familiar with the methods described in
|
||||
!!! Note
|
||||
All callback methods described below should only be implemented in a strategy if they are actually used.
|
||||
|
||||
## Custom stoploss logic
|
||||
|
||||
// TODO: Complete this section
|
||||
|
||||
|
||||
## Custom order timeout rules
|
||||
|
||||
Simple, timebased order-timeouts can be configured either via strategy or in the configuration in the `unfilledtimeout` section.
|
||||
|
@ -254,6 +254,24 @@ class IStrategy(ABC):
|
||||
"""
|
||||
return True
|
||||
|
||||
def stoploss_value(self, pair: str, trade: Trade, rate: float, **kwargs) -> float:
|
||||
"""
|
||||
Define custom stoploss logic
|
||||
The custom stoploss can never be below self.stoploss, which serves as a hard maximum loss.
|
||||
|
||||
|
||||
For full documentation please go to https://www.freqtrade.io/en/latest/strategy-advanced/
|
||||
|
||||
When not implemented by a strategy, returns the initial stoploss value
|
||||
|
||||
:param pair: Pair that's about to be sold.
|
||||
:param trade: trade object.
|
||||
:param rate: Rate that's going to be used when using limit orders
|
||||
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
|
||||
:return float: New stoploss value, relative to the open price
|
||||
"""
|
||||
return self.stoploss
|
||||
|
||||
def informative_pairs(self) -> ListPairsWithTimeframes:
|
||||
"""
|
||||
Define additional, informative pair/interval combinations to be cached from the exchange.
|
||||
|
Loading…
Reference in New Issue
Block a user