Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

place trade order use type TRAILING_STOP_MARKET #28

Open
aref-r opened this issue Mar 29, 2024 · 11 comments
Open

place trade order use type TRAILING_STOP_MARKET #28

aref-r opened this issue Mar 29, 2024 · 11 comments

Comments

@aref-r
Copy link

aref-r commented Mar 29, 2024

hello, I want to open trade order in perpetual futures with this endpoint :
/openApi/swap/v2/trade/order
and the type is TRAILING_STOP_MARKET
as the documentation confirmed, there is three field for TRAILING_STOP_MARKET :
"activationPrice",
"priceRate",
"price"
I couldn't find a perfect explanation for these three field in doc .

I want to set takeprofit and stoploss too,
but seems these two field is Only supports type: STOP_MARKET/STOP or Only supports type: TAKE_PROFIT_MARKET/TAKE_PROFIT.
and I have no idea to insert takeprofit price and stoploss price when opening order, can any one help me ?

@bingx-support
Copy link

bingx-support commented Mar 30, 2024 via email

@aref-r
Copy link
Author

aref-r commented Mar 31, 2024

Hello, You can place an individual order with type=TRAILING_STOP_MARKET.

If I create an individual order, how to link the new order to the previous order? (to prevent create additional order)

@bingx-support
Copy link

bingx-support commented Mar 31, 2024 via email

@aref-r
Copy link
Author

aref-r commented Apr 1, 2024

thanks, But for set the takeProfit and stopLoss in single api request, what type I have to use for order ?
because you specified in the documentation :

stopLoss : Only supports type: STOP_MARKET/STOP
takeProfit : Only supports type: TAKE_PROFIT_MARKET/TAKE_PROFIT

@bingx-support
Copy link

bingx-support commented Apr 1, 2024 via email

@aref-r
Copy link
Author

aref-r commented Apr 1, 2024

Yes I know,
I mean the first api for place order (before trailing) . what type for this order I have to use ? just as the takeProfit and stopLoss need to separate type and don't have an in common type.

for example if I use MAEKET type for place new order , I can not set the takeProfit and stopLoss , and I have to send separate api with type TRAILING_TP_SL after create order.

I need to set TP & SL in first request, not the second. (before trailing)

generally is it necessary to send twice api request ?

@bingx-support
Copy link

bingx-support commented Apr 2, 2024 via email

@fdbatista
Copy link

Hi.
I am trying to do the same.

AFAIK there is no way to set the take profit and stop loss at the same time in the original request, so I need to send 3 different requests. The first one for placing the order, the second one to set the stop loss and the third one for the take profit.

That really sounds like nonsense to me, because if I have 3 different open positions, I don't have a way to set the stop loss or take profit for a specific one. How would the system know the ID of the order I am referring to? Would it automatically choose the first one, the last one or a random one?

And not to mention that the official docs are misleading, to say the least.

@fdbatista
Copy link

Yes I know, I mean the first api for place order (before trailing) . what type for this order I have to use ? just as the takeProfit and stopLoss need to separate type and don't have an in common type.

for example if I use MAEKET type for place new order , I can not set the takeProfit and stopLoss , and I have to send separate api with type TRAILING_TP_SL after create order.

I need to set TP & SL in first request, not the second. (before trailing)

generally is it necessary to send twice api request ?

Hey man, did you manage to solve this?

@bingx-support
Copy link

bingx-support commented Jan 7, 2025 via email

@fdbatista
Copy link

Hello, You can refer to the demo from the API doc to place an MARKET/LIMIT order with TP/SL. https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Place%20order [image]

From: "Felix @.> Date: Mon, Jan 6, 2025, 23:24 Subject: Re: [BingX-API/BingX-swap-api-doc] place trade order use type TRAILING_STOP_MARKET (Issue #28) To: @.> Cc: @.>, @.> > Yes I know, I mean the first api for place order (before trailing) . what type for this order I have to use ? just as the takeProfit and stopLoss need to separate type and don't have an in common type. > for example if I use MAEKET type for place new order , I can not set the takeProfit and stopLoss , and I have to send separate api with type TRAILING_TP_SL after create order. > I need to set TP & SL in first request, not the second. (before trailing) > generally is it necessary to send twice api request ? Hey man, did you manage to solve this? — Reply to this email directly, view it on GitHub<#28 (comment)>, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BFJFFAQDN7PQRS3WGQQZPYD2JKN2LAVCNFSM6AAAAABUTNBCO6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZTGMZTOOBZGU. You are receiving this because you commented.[image: https://github.com/notifications/beacon/BFJFFARXGARNAUYZ7GFXIHT2JKN2LA5CNFSM6AAAAABUTNBCO6WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUZMICSO.gif]Message ID: @.***>

Hi. Thanks for your reply, but that's not what I need.
I want an example for TRAILING_SL_TP, which is not present in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants