JKorf / BingX.Net

A C# .netstandard client library for the BingX REST and Websocket Spot and Futures API focusing on clear usage and models
https://jkorf.github.io/BingX.Net/
MIT License
6 stars 4 forks source link

No data updates in user order updates stream #9

Closed Akunin88 closed 7 hours ago

Akunin88 commented 2 weeks ago

When I place orders via API there are no any updates in the user's stream. I use jk.bingx.net 1.3.1. For subscription (onOrderUpdate) I use method socketClient.PerpetualFuturesApi.SubscribeToUserDataUpdatesAsync I place orders (market or limit) by using method restClient.PerpetualFuturesApi.Trading.PlaceOrderAsync

In the same time when I place/cancel limit/market orders using web-browser then I receive updates in the user's stream.

Probably there are some errors with data parsing (see picture). These errors occurred when I used the socketClient.PerpetualFuturesApi.SubscribeToUserDataUpdatesAsync method with any subscriptions. 123

JKorf commented 2 weeks ago

Hi, I don't think that exception is related. It's handled internally and caused by the server sending the literal string 'Ping' instead of a json message.

I just tried to place an order and it seems to work for me, can you provide me with the code and parameters you use?

Akunin88 commented 2 weeks ago

This started working normally while I'm prepared a test project 🤯 But it didn't work normally a few hours ago. I'll try to reproduce this problem tomorrow. Here's a test project ConsoleTest.zip

JKorf commented 2 weeks ago

That probably means there was indeed an error while parsing the update, but its hard to say what it was when its working now haha. Please let me know if it doesn't work again/you figure out what this issue is

Akunin88 commented 2 weeks ago

I couldn't found the reason why this was happening. But sometimes it occurs (about in 2% cases, more often with market orders).

I found another bug: clientOrderId will not be returned with updates in the user stream. I attach test project ConsoleTest2.zip 1234

JKorf commented 1 week ago

I assume you're using the SpotApi then? I checked the docs, but it listed there either, so I guess it's not returned from the server. Even though it is in the futures API.

Akunin88 commented 5 days ago

I'm using futures api (RestClient.PerpetualFuturesApi.Trading.PlaceOrderAsync method) Seems like server does not return clientOrderId.

Other question. Are there any plans to support SL and TP values for placing orders in the next versions?

JKorf commented 3 days ago

I had some troubles implementing it initially, but yeah I'll have a look at it again

JKorf commented 2 days ago

I've added it in the latest version, seems to work correctly now :)

Akunin88 commented 7 hours ago

I've tested both trade direction, placing limit orders with SL and TP values. Looks like it works perfectly :) Thank you!