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:
dekun
2026-06-07 17:38:26 +08:00
parent d56d9050aa
commit 0760873d9d
3 changed files with 82 additions and 11 deletions
+6
View File
@@ -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,