Git Product home page Git Product logo

bitmex-liquidations's Introduction

Solving Artificial Intelligence one step at a time ๐Ÿ‘‹

Are you an individual / company willing to invest in open source? Become a sponsor!

bitmex-liquidations's People

Contributors

philipperemy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

bitmex-liquidations's Issues

Getting past data

Do you know if there is a way of getting past liquidation data?
Like getting data from liquidation since 01/01/2020 to 18/01/2020

Web socket disconnecting after 2 days, can we run only example.py --symbol for production

I ran the example.py XBTUSD and see that the script stopped running after two days.

Error message:

Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.6/site-packages/websocket/_app.py", line 278, in run_forever
    dispatcher.read(self.sock.sock, read)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/websocket/_app.py", line 63, in read
    callback()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/websocket/_app.py", line 251, in read
    op_code, frame = self.sock.recv_data_frame(True)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/websocket/_core.py", line 330, in recv_data_frame
    frame = self.recv_frame()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/websocket/_core.py", line 364, in recv_frame
    return self.frame_buffer.recv_frame()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/websocket/_abnf.py", line 361, in recv_frame
    self.recv_header()
  File "/home/ubuntu/.local/lib/python3.6/site-packages/websocket/_abnf.py", line 309, in recv_header
    header = self.recv_strict(2)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/websocket/_abnf.py", line 396, in recv_strict
    bytes_ = self.recv(min(16384, shortage))
  File "/home/ubuntu/.local/lib/python3.6/site-packages/websocket/_core.py", line 434, in _recv
    return recv(self.sock, bufsize)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/websocket/_socket.py", line 94, in recv
    "Connection is already closed.")
websocket._exceptions.WebSocketConnectionClosedException: Connection is already closed.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.6/logging/__init__.py", line 994, in emit
    msg = self.format(record)
  File "/usr/lib/python3.6/logging/__init__.py", line 840, in format
    return fmt.format(record)
  File "/usr/lib/python3.6/logging/__init__.py", line 577, in format
    record.message = record.getMessage()
  File "/usr/lib/python3.6/logging/__init__.py", line 338, in getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting
Call stack:
  File "/usr/lib/python3.6/threading.py", line 884, in _bootstrap
    self._bootstrap_inner()
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/home/ubuntu/datahub/src/indicators/bitmex-liquidations/bitmex_liquidation/api.py", line 111, in <lambda>
    self.wst = threading.Thread(target=lambda: self.ws.run_forever(ping_interval=5),
  File "/home/ubuntu/.local/lib/python3.6/site-packages/websocket/_app.py", line 280, in run_forever
    self._callback(self.on_error, e)
  File "/home/ubuntu/.local/lib/python3.6/site-packages/websocket/_app.py", line 315, in _callback
    callback(self, *args)
  File "/home/ubuntu/datahub/src/indicators/bitmex-liquidations/bitmex_liquidation/api.py", line 147, in _on_error
    logger.info('on_error()', error)
Message: 'on_error()'
Arguments: (WebSocketConnectionClosedException('Connection is already closed.',),)
2020-04-14 23:05:13,037 - Websocket Closed

How do you fetch USD Values

Hello,

Thank you for sharing your liquidation bot.

I was wondering, how are you able to convert a contract size value to USD, aside from XBT?

I have seen, that you used:

usd_value = price * qty if not symbol.startswith('XBT') else qty

But I think that is not all. Since if I cross check that formula with your website's values they are all different.

Looking at for example ETHUSD each contract is worth 0.001 mXBT per $1 price, currently 0.00121444 XBT. A simple price * qty should not be enough.

Another not clear example would be:
img

If I do price * qty it would result in 63 and not 2, as shown in the screenshot. I might be missing something here, thats why I thought to shoot you a message.

Aside from that I have also noticed that the usd_value is different from the GitHub's version vs the rek.to.

GitHub Bot:
img

Website:
img

GH Bot has USD = 1,935. Website = 68.

When looking at bitmex.com the order value of 7,000 XRP is also a complete different one:

img

Thanks for enlighten me on this.

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.