You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/strategy-callbacks.md
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -178,6 +178,8 @@ Returning `None` will be interpreted as "no desire to change", and is the only s
178
178
179
179
Stoploss on exchange works similar to `trailing_stop`, and the stoploss on exchange is updated as configured in `stoploss_on_exchange_interval` ([More details about stoploss on exchange](stoploss.md#stop-loss-on-exchangefreqtrade)).
180
180
181
+
If you're on futures markets, please take note of the [stoploss and leverage](stoploss.md#stoploss-and-leverage) section, as the stoploss value returned from `custom_stoploss` is the risk for this trade - not the relative price movement.
182
+
181
183
!!! Note "Use of dates"
182
184
All time-based calculations should be done based on `current_time` - using `datetime.now()` or `datetime.utcnow()` is discouraged, as this will break backtesting support.
183
185
@@ -233,7 +235,7 @@ class AwesomeStrategy(IStrategy):
233
235
:param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
234
236
:return float: New stoploss value, relative to the current_rate
235
237
"""
236
-
return-0.04
238
+
return-0.04* trade.leverage
237
239
```
238
240
239
241
#### Time based trailing stop
@@ -255,9 +257,9 @@ class AwesomeStrategy(IStrategy):
255
257
256
258
# Make sure you have the longest interval first - these conditions are evaluated from top to bottom.
257
259
if current_time - timedelta(minutes=120) > trade.open_date_utc:
0 commit comments