From 7c010b3058f33040e092dd5a0d76804f18a48c39 Mon Sep 17 00:00:00 2001 From: Stefano Ariestasia Date: Wed, 19 Jan 2022 22:16:42 +0900 Subject: [PATCH] Update strategy-callbacks.md --- docs/strategy-callbacks.md | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/strategy-callbacks.md b/docs/strategy-callbacks.md index f0f9a1853..7a4aed5d6 100644 --- a/docs/strategy-callbacks.md +++ b/docs/strategy-callbacks.md @@ -652,9 +652,6 @@ class DigDeeperStrategy(IStrategy): if last_candle['close'] < previous_candle['close']: return None - filled_buys = trade.select_filled_orders('buy') - count_of_buys = len(filled_buys) - # Allow up to 3 additional increasingly larger buys (4 in total) # Initial buy is 1x # If that falls to -5% profit, we buy 1.25x more, average profit should increase to roughly -2.2% @@ -663,15 +660,14 @@ class DigDeeperStrategy(IStrategy): # Total stake for this trade would be 1 + 1.25 + 1.5 + 1.75 = 5.5x of the initial allowed stake. # That is why max_dca_multiplier is 5.5 # Hope you have a deep wallet! - if 0 < count_of_buys <= self.max_buy_position_adjustment: - try: - # This returns first order stake size - stake_amount = filled_buys[0].cost - # This then calculates current safety order size - stake_amount = stake_amount * (1 + (count_of_buys * 0.25)) - return stake_amount - except Exception as exception: - return None + try: + # This returns first order stake size + stake_amount = filled_buys[0].cost + # This then calculates current safety order size + stake_amount = stake_amount * (1 + (count_of_buys * 0.25)) + return stake_amount + except Exception as exception: + return None return None