PipedreamHQ / pipedream

Connect APIs, remarkably fast. Free for developers.
https://pipedream.com
Other
8.58k stars 5.27k forks source link

[BUG] BingX: trade_oneclick_close_all_positions doesn't work #6320

Closed BOfH85 closed 1 year ago

BOfH85 commented 1 year ago

Description When you trigger this action, no matter which trigger provided, you can't give any paramets, since this action doesn't request one. Yet when you fire the action, no positions at BingX are closed and the return message just says:

Invalid parameters, err:Key: 'APIOneClickClosePositionRequest.Symbol' Error:Field validation for 'Symbol' failed on the 'endswith' tag Key: 'APIOneClickClosePositionRequest.PositionID' Error:Field validation for 'PositionID' failed on the 'gt' tag

To Reproduce Steps to reproduce the behavior:

  1. Create a new Workflow
  2. Select any trigger. eg a Webhook
  3. select "BingX" as action and chose trade_oneclick_close_all_positions
  4. Apply your BingX Account to it
  5. Make sure you have at least one open position in BingX Perpetual Futures Trading Account to be closed
  6. Fire the Webhook and see the error message
  7. Positions stay open

Workaround I found out, if you just use the "Generic API Call" Function and place the API Path "/api/v1/user/oneClickCloseAllPositions" in it, this will work perfectly. So whatever your "trace_oneclick_close_all_positions" does, it certainly doesn't, what the BingX API expects: To simpley call "/api/v1/user/oneClickCloseAllPositions" as HTTP-POST.

Expected behavior The Workflow should work as designed and close all open positions at Market Price and don't return weird error messages reffering to PosionIDs you can't even provide as input parameter of the action. Like described above, my simple self-made-workaround does the job as expected.

Additional context This is a very urgent thing for me since my whole autotrading strategy depends on this action to work properly. Otherwise I only could open positions automatically but never close them when they reach TP or SL Level.

Thanks in Advance.

vunguyenhung commented 1 year ago

Hi, as this is already confirmed by @BOfH85 that the API works, and the PR change the API. I will move this to ready for release! Thanks