fix: triggerDirection для Bybit safety stop + paper mode balance display

Bybit futures stop-ордера требуют triggerDirection:
- Long safety (sell stop): "2" (цена падает)
- Short safety (buy stop): "1" (цена растёт)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
anor
2026-03-15 04:36:24 +10:00
co-authored by Claude Opus 4.6
parent 824b6db1ac
commit bfbd7a2917
+4
View File
@@ -221,10 +221,14 @@ class FuturesExecutor:
"triggerPrice": trigger_price, "id": "dry_run"}
try:
# Long safety: sell when price drops → descending
# Short safety: buy when price rises → ascending
trigger_dir = "2" if side == "long" else "1" # Bybit: 1=rise, 2=fall
order = self.exchange.create_order(
symbol, "market", close_side, amount,
params={
"triggerPrice": str(trigger_price),
"triggerDirection": trigger_dir,
"reduceOnly": True,
},
)