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

Alternative orderings for a order books #9

Open
davidrpugh opened this issue Mar 7, 2017 · 0 comments
Open

Alternative orderings for a order books #9

davidrpugh opened this issue Mar 7, 2017 · 0 comments

Comments

@davidrpugh
Copy link

@bherd-rb At present the FourHeapOrderBook class stores orders sorted according to price. However, in real double auctions there are at least three commonly used orderings: price-time priority, pro-rata, and price-size.

With price-time ordering, orders are first sorted according to price; orders with the same price are then sorted ascending according to some timestamp (orders would be timestamped on receipt by the auction). If the limit price is a Double then ties are unlikely to occur. If limit price is a Long, then ties will occur fairly frequently.

Price-size ordering is similar to price-time ordering except that the secondary ordering is descending according to quantity (i.e., priority is given to larger orders).

Pro-rata ordering is a bit more complicated in that orders with the same price are filled in proportion to their respective quantities. Actually whilst pro-rata is usually discussed as an ordering, it seems like it couples price ordering with a matching algorithm.

Obviously, price-size and pro-rate only make sense in the context of multi-unit auctions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant