binance / binance-connector-python

Simple connector to Binance Public API
MIT License
1.89k stars 490 forks source link

trailingDelta on create margin order #222

Closed AngDrew closed 1 year ago

AngDrew commented 1 year ago

Good day, guys!

Is there any option to use trailingDelta on margin orders? I can't find it anywhere, and after reading very long documentation, I found that there's no trailingDelta parameter on the Binance API margin order

The only thing margin can have trailingDelta is using bapi/* endpoint, which I know by inspecting the network on Binance's margin trading. Still, I need help finding the documentation on the internet.

Issue subject

trailingDelta is not a parameter on margin order

Expected behavior

trailingDelta added to the margin order (cross and isolated)

Actual behavior

trailingDelta is not a parameter on margin order

Steps to reproduce

this order below is automatically converted to a stop limit order instead of a trailing stop. Oh, by the way, I use python-binance, not binance connector, but since this issue is still related to Binance API, I will post it here.

client.create_margin_order( symbol=symbol, side=SIDE_SELL, type=ORDER_TYPE_TAKE_PROFIT_LIMIT, # timeInForce=TIME_IN_FORCE_GTC, quantity=quantity, stopPrice=tp_price, price=tp_price, trailingDelta=td,

isolatedSymbol=symbol,

# isIsolated=is_margin,

)

Environment

Provide any relevant information about your setup, such as:

2pd commented 1 year ago

Thank you for feedback. Trailing stop order is not supported on margin account. Please check the official document at https://binance-docs.github.io/apidocs/spot/en/#margin-account-new-order-trade