From 761af1f974cc548997ac70c4a17f59847f041db3 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 21 Jun 2022 06:51:46 +0200 Subject: [PATCH] Imrpove example --- docs/strategy-callbacks.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/strategy-callbacks.md b/docs/strategy-callbacks.md index 817a15955..05d0998b8 100644 --- a/docs/strategy-callbacks.md +++ b/docs/strategy-callbacks.md @@ -716,6 +716,10 @@ class DigDeeperStrategy(IStrategy): Return None for no action. """ + if current_profit > 0.05 and trade.nr_of_successful_exits == 0: + # Take half of the profit at +5% + return -(trade.amount / 2) + if current_profit > -0.05: return None