dyn4mik3 / orderbook Goto Github PK
View Code? Open in Web Editor NEWMatching Engine for Limit Order Book
License: Other
Matching Engine for Limit Order Book
License: Other
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.
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)
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).
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?
When trying to use from orderbook import OrderBook
I get ImportError: cannot import name 'OrderBook' from partially initialized module 'orderbook'
line 138 orderbook.py (prce => price)
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'
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
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
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.