From 6636a2fda8dd4c820296b32f109247f4cedd72b7 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 5 Mar 2025 20:27:53 +0100 Subject: [PATCH] docs: improved adjust_trade_position sample --- docs/strategy-callbacks.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/strategy-callbacks.md b/docs/strategy-callbacks.md index 8c9dd1a2e..8286ee9bf 100644 --- a/docs/strategy-callbacks.md +++ b/docs/strategy-callbacks.md @@ -876,6 +876,9 @@ class DigDeeperStrategy(IStrategy): Return None for no action. Optionally, return a tuple with a 2nd element with an order reason """ + if trade.has_open_orders: + # Only act if no orders are open + return if current_profit > 0.05 and trade.nr_of_successful_exits == 0: # Take half of the profit at +5%