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:
@@ -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,
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user