Git Product home page Git Product logo

orderbook's People

Contributors

bgn9000 avatar chuacheowhuan avatar dyn4mik3 avatar grantjenks avatar joequant 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  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  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  avatar

Watchers

 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

orderbook's Issues

License

Much of this code looks like it's straight from github.com/ab24v07/PyLOB which is under the MIT license. You must retain the original copyright with the MIT license.

Help:Import Error

I have installed orderbook by pip, but I get this error when I import it:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\50395\Desktop\CLOB\venv\lib\site-packages\orderbook\__init__.py", line 1, in <module>
    from orderbook import OrderBook
ImportError: cannot import name 'OrderBook' from 'orderbook' (C:\Users\50395\Desktop\CLOB\venv\lib\site-packages\orderbook\__init__.py)

Needs tests

Suggestion: use Hypothesis for generating random cases (order lists), and check invariants on them (i.e. same amount of money and shares before/after matching).

bintrees is deprecated, suggests sortedcontainers

Hi, I'm the author of sortedcontainers and noticed that you're using the bintrees module. If you look at the PyPI page for bintrees then you'll see that development has stopped and sortedcontainers is recommended instead.

I'd love to see sortedcontainers used in more places. If I created a pull request which replaced bintrees with sortedcontainers, would that be merged?

typo issue

line 138 orderbook.py (prce => price)

AttributeError

Traceback (most recent call last):
  File "algosim.py", line 141, in <module>
    myalgo.process_trade(trade, 'trade')
AttributeError: 'NoneType' object has no attribute 'process_trade'

the order has no symbol

For a limit order

quote = {
'type' : 'limit',
'side' : 'bid',
'quantity' : 6,
'price' : 108.2,
'trade_id' : 001
}

it maybe :
quote = {
'type' : 'limit',
‘symbol': 'GOOG'
'side' : 'bid',
'quantity' : 6,
'price' : 108.2,
'trade_id' : 001
}

if want to cancel a order by order_id, we need to know the symbol then find the orderbook which is not efficient, we may need a OrderBooks class. which has a global order_map, and many orderbook

Help: MongoDB

Hello @dyn4mik3 and merry christmas!

I'm cooking up an idea with a friend and we would like to use your OrderBook source code, hope it's alright, but we need to have a database storing all the information.

Could you give me some light on how could I modify the script to use it with MongoDB?

Thank you

move_to_tail bug

Hi, there is a non termination bug while traversing an orderlist (printing the orderbook) after modifying an order with a larger quantity. A minimum reproducible example is available in this gist.

The output from running the minimum reproducible example, a manual control C (keyboard interupt) has to be executed to terminate the program:

***Bids***
10@1/0 - 1
20@1/1 - 2
30@1/2 - 3

***Asks***

***Trades***


^CTraceback (most recent call last):
  File "test_modify_orders.py", line 39, in <module>
    print(order_book)
  File "/Users/hadron0/gitHubRepo/OrderBook/orderbook/orderbook.py", line 222, in __str__
    tempfile.write('%s' % value)
  File "/Users/hadron0/gitHubRepo/OrderBook/orderbook/orderlist.py", line 102, in __str__
    temp_file.write("%s\n" % str(order))
  File "/Users/hadron0/gitHubRepo/OrderBook/orderbook/order.py", line 39, in __str__
    self.trade_id, self.timestamp)
KeyboardInterrupt

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.