Added imports to documentation for clarification when using custom stoploss

Signed-off-by: hoeckxer <hawkeyenl@yahoo.com>
This commit is contained in:
hoeckxer 2020-12-31 21:05:47 +01:00
parent 885da85fce
commit e5840abaf9
1 changed files with 4 additions and 0 deletions

View File

@ -23,6 +23,10 @@ E.g. `current_profit = 0.05` (5% profit) - stoploss returns `0.02` - then you "l
To simulate a regular trailing stoploss of 4% (trailing 4% behind the maximum reached price) you would use the following very simple method:
``` python
# additional imports required
from freqtrade.persistence import Trade
from datetime import datetime
use_custom_stoploss = True
def custom_stoploss(self, pair: str, trade: Trade, current_time: datetime, current_rate: float,