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

Improve Order Error Message #19

Open
4 tasks done
AlexCatarino opened this issue Mar 5, 2024 · 0 comments
Open
4 tasks done

Improve Order Error Message #19

AlexCatarino opened this issue Mar 5, 2024 · 0 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@AlexCatarino
Copy link
Member

Expected Behavior

Users are informed of the cause of invalid orders.

Actual Behavior

The algorithm received the following information

2024-03-05T15:05:00.7148461Z TRACE:: LiveTradingResultHandler.OrderEvent(): Time: 03/05/2024 15:05:00 OrderID: 2 EventID: 1 Symbol: BTCUSDT Status: Invalid Quantity: -0.047175 Message: Brokerage failed to place orders: [2] BrokerId:

and we don't know why.

When we inpect the syslog, we can read:

ErrorMessage: Cross Margin Trading not yet supported by the selected coin

2024-03-05T15:05:00.7146835Z ERROR:: BrokerageTransactionHandler.HandleSubmitOrderRequest():  System.Exception: ByBitApiClient request failed: [200] OK, Content: {"retCode":170037,"retMsg":"Cross Margin Trading not yet supported by the selected coin","result":{},"retExtInfo":{},"time":1709651100616}, ErrorCode: 170037 ErrorMessage: Cross Margin Trading not yet supported by the selected coin
   at QuantConnect.Brokerages.Bybit.Api.BybitTradeApiEndpoint.PlaceOrder(BybitProductCategory category, Order order, Boolean useMargin)
   at QuantConnect.Brokerages.Bybit.BybitBrokerage.g.d()
   at QuantConnect.Brokerages.BrokerageConcurrentMessageHandler`1.WithLockedStream(Action code) in /LeanCloud/CI.Builder/bin/Debug/src/QuantConnect/LeanEnterprise/Brokerages/BrokerageConcurrentMessageHandler.cs:line 82
   at QuantConnect.Brokerages.Bybit.BybitBrokerage.PlaceOrder(Order order)

The user should receive that error message instead of "Brokerage failed to place orders" or as a Brokerage Message.

Potential Solution

N/A

Reproducing the Problem

SetHolding("BTCUSDT", 1);
then
SetHolding("BTCUSDT", 0);

Checklist

  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
  • I have provided detailed steps to reproduce the issue
@AlexCatarino AlexCatarino added bug Something isn't working enhancement New feature or request labels Mar 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant