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

WebSocket V5PrivateApi SubscribeToOrderUpdatesAsync missing enum #211

Open
pgrimstrup opened this issue May 27, 2024 · 1 comment
Open

Comments

@pgrimstrup
Copy link

Hi. I am using V5PrivateApi.SubscribeToOrderUpdatesAsync to listen for changes to orders, and noticed a log error message:

Cannot map enum value. EnumType: StopLossTakeProfitMode, Value: UNKNOWN, Known values: Full, Partial. If you think UNKNOWN should added please open an issue on the Github repo

I had my program listening for orders, while I placed an order without any SL/TP using the ByBit website. However if a place an order with a SL/TP, the error does not show.

Note that the order is still received via web socket, with the TpSlMode property set to null. The message is just a logged warning and doesn't impact the API in any way (low priority).

@pgrimstrup
Copy link
Author

pgrimstrup commented Jun 3, 2024

Started using Trailing Stops via the SetTradingStop() method and I am also receiving this error message;

Cannot map enum value. EnumType: StopOrderType, Value: TrailingProfit, Known values: TakeProfit, StopLoss, TrailingStop, Stop, PartialStopLoss, PartialTakeProfit, tpslOrder, OcoOrder, MmRateClose, BidirectionalTpslOrder. If you think TrailingProfit should added please open an issue on the Github repo

It appears to be pseudonym for TrailingStop, or just a typo from the API itself. It appears in the websocket feed for orders when a trailing stop is entered. As a result, the order is received as a Market Sell order as the StopOrderType field cannot be parsed.

A workaround appears to be to check the CreateType field for "CreateByTrailingProfit" to identify the order as a Take Profit order.

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

1 participant