Code Monkey home page Code Monkey logo

Comments (8)

slazarov avatar slazarov commented on May 17, 2024

Hi @cmollen and welcome!
Subscribe_to_orderbook_update() gives you only nounces and Its intended to do so. It’s used in the case when users have their own syncing mechanism, I.e through api request.

With regards to your last paragraph, this only applies when you subscribe to market updates, if you subscribe to the order book or executed trades, then the specific ticker is invoked.
I’m on the phone so I hope this is as clear as possible.

from python-bittrex-websocket.

cmollen avatar cmollen commented on May 17, 2024

Thanks for the quick reply, all clear! I would assume that my use case is more common (wanting to capture and store the orderbook for future recreation, without wasting space on levels that haven't changed), but the change was minimal so I will just keep my own branch then.

from python-bittrex-websocket.

slazarov avatar slazarov commented on May 17, 2024

If you want to keep a live orderbook you should use subscribe_to_orderbook. With respect to the wasting space on levels, I don’t completely understand what you mean :).

from python-bittrex-websocket.

cmollen avatar cmollen commented on May 17, 2024

:) I don't want to keep a live orderbook, I want to store the orderbook to disk and be able to recreate it at a later time for analysis and backtesting. If I store every update passed to the on_orderbook() callback to disk, I will be wasting disk space as it passes all levels of the orderbook, and not just the levels that have been updated. So if I subscribe to 50 levels and only one is updated, I still need to save 50 levels, or check every single update to see which levels have changed.

from python-bittrex-websocket.

slazarov avatar slazarov commented on May 17, 2024

With subscribe_to_orderbook_update you will only get the nounces, this is exactly what you need.

from python-bittrex-websocket.

cmollen avatar cmollen commented on May 17, 2024

As stated in the first post, the only thing lacking with subscribe_to_orderbook_update is that it doesn't have the option to return the full state in the first update. Otherwise, it is impossible to recreate the full orderbook state. And seeing as the snapshot sync is already implemented for SUB_TYPE_ORDERBOOK, it seems like a waste to re-implement it on the outside.

from python-bittrex-websocket.

slazarov avatar slazarov commented on May 17, 2024

I agree that the option of requesting a full order book snapshot to be implemented, but don’t agree that it should be part of the update method. Although in your case it applies, it should be made general. I could implement it as a new method.

from python-bittrex-websocket.

cmollen avatar cmollen commented on May 17, 2024

That would be much appreciated. If you want to keep the number of callback methods down, one suggestion for making it more general would be to augment each level of the snapshot with a Type: 0 on the first call to on_orderbook_update. Then the format and the semantics would be the same for the snapshot and the subsequent updates.

from python-bittrex-websocket.

Related Issues (20)

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.