fix(trend): use mark price for DCA trigger on gate_bot
Poll trend plans with mark price (same as UI) instead of ticker last, add get_symbol_mark_price to gate_bot, tolerate position API blips, and log DCA order failures. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -17,6 +17,12 @@ def test_trend_dca_short_not_before_first_level():
|
||||
assert trend_dca_level_reached(direction, 0.3413, 0.3413)
|
||||
|
||||
|
||||
def test_trend_dca_long_mark_below_trigger():
|
||||
direction = "long"
|
||||
assert trend_dca_level_reached(direction, 0.344, 0.3465)
|
||||
assert not trend_dca_level_reached(direction, 0.347, 0.3465)
|
||||
|
||||
|
||||
def test_trend_effective_margin_first_leg_only():
|
||||
plan = {
|
||||
"plan_margin_capital": 12.11,
|
||||
|
||||
Reference in New Issue
Block a user