Update strategy-callbacks.md
This commit is contained in:
parent
ac93eea585
commit
7c010b3058
@ -652,9 +652,6 @@ class DigDeeperStrategy(IStrategy):
|
|||||||
if last_candle['close'] < previous_candle['close']:
|
if last_candle['close'] < previous_candle['close']:
|
||||||
return None
|
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)
|
# Allow up to 3 additional increasingly larger buys (4 in total)
|
||||||
# Initial buy is 1x
|
# Initial buy is 1x
|
||||||
# If that falls to -5% profit, we buy 1.25x more, average profit should increase to roughly -2.2%
|
# 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.
|
# 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
|
# That is why max_dca_multiplier is 5.5
|
||||||
# Hope you have a deep wallet!
|
# Hope you have a deep wallet!
|
||||||
if 0 < count_of_buys <= self.max_buy_position_adjustment:
|
try:
|
||||||
try:
|
# This returns first order stake size
|
||||||
# This returns first order stake size
|
stake_amount = filled_buys[0].cost
|
||||||
stake_amount = filled_buys[0].cost
|
# This then calculates current safety order size
|
||||||
# This then calculates current safety order size
|
stake_amount = stake_amount * (1 + (count_of_buys * 0.25))
|
||||||
stake_amount = stake_amount * (1 + (count_of_buys * 0.25))
|
return stake_amount
|
||||||
return stake_amount
|
except Exception as exception:
|
||||||
except Exception as exception:
|
return None
|
||||||
return None
|
|
||||||
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user