Giter VIP home page Giter VIP logo

lean.brokerages.bybit's People

Contributors

alexcatarino avatar arodus avatar jaredbroad avatar jhonabreul avatar martin-molinero avatar romazes avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lean.brokerages.bybit's Issues

Exception during funding when running live

When running live and there is an open position when funding happens an exception is thrown and the algo stops. Apparently, I never had a trade open during funding when I was initially testing this brokerage ๐Ÿ™ˆ

Expected Behavior

The brokerage handles the funding ws message properly.

Actual Behavior

A serialization exception is thrown cause there is no OrderType which equals UNKNOWN

Potential Solution

Add UNKNOWN to the OrderType enum and handle the funding message properly. @Martin-Molinero do we need to submit an order update when funding occurs?

Reproducing the Problem

Having an open order when funding occurs. I unfortunately don't have the exact log anymore.

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

Order can not always be canceled

Expected Behavior

Orders are being canceled at all times without issues.

Actual Behavior

Some orders can not always be canceled, it happens in multiple occasions but It seems I found one way to reliably reproduce it. (See reproducing the problem)

Potential Solution

Don't raise an error when the status is CancelPending here:

if (order.Status is OrderStatus.Canceled or OrderStatus.CancelPending)
{
OnMessage(new BrokerageMessageEvent(BrokerageMessageType.Warning, -1,
"Order already canceled or cancellation submitted"));
return;
}

It seems that sometimes the order status is already CancelPending even though the cancel request was never sent to the brokerage.

Reproducing the Problem

  • Create an empty algo using the bybit brokerage. Which calls liquidate after startup.
  • Manually create an order in the exchange
  • Start the algorithm, the following error should pop up:
20231129 06:56:56.592 ERROR:: Brokerage Warning: Order already canceled or cancellation submitted
20231129 06:56:56.593 ERROR:: Brokerage failed to cancel order with id 1

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.