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

Provide meaningful code example for C implementation #17

Open
kvak opened this issue Aug 10, 2018 · 1 comment
Open

Provide meaningful code example for C implementation #17

kvak opened this issue Aug 10, 2018 · 1 comment

Comments

@kvak
Copy link

kvak commented Aug 10, 2018

Dear nlsdfnbch,

Thanks for your work on this library.

I had a quick question. The following sequence of orders leads to a raise NotImplementedError:

        from lob import LimitOrderBook, Order
        lob = LimitOrderBook()
        orders = [
            Order(uid=5879, is_bid=False, size=550, price=26.0),
            Order(uid=5879, is_bid=False, size=0, price=26.0),
            Order(uid=5880, is_bid=False, size=80, price=38.0),
            Order(uid=5881, is_bid=False, size=100, price=22.7)
            ]
        
        for order in orders:
             lob.process(order)

This has been discussed here.

My question is: could you put out a small code example for calling the C implementation? The test sets are a really tough access point for non C literates~.

Basically, an example, say run the list of orders above but calling the C code, would really help!

@deepbrook deepbrook self-assigned this Sep 1, 2018
@deepbrook
Copy link
Collaborator

Hey @kvak,

Sorry for the slow reply! Yes, indeed this has been requested a couple of times, and I started working on this. The problem is, the library still misses some functionality in order to be used the way you suggest in your example.

For example, I do not supply hashmaps to key limits and order_ids, and I have no struct (nor an interface for) an actual book.

However, I've started adding these bits, and will continue working on them. Once that is done, and I can give an example that does not involve programming several dozen lines of code for a simple example like yours, I will add this to the readme.

@deepbrook deepbrook changed the title Question (not issue) Provide meaningful code example for C implementation Sep 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants