Limit Order Book Simulation (Scripts) Publisher's description
from Yuanhang Wang
This difference here is this is pure limit order driven, i.e. 'Market Order' is considered as limit order with limit price higher or lower than current market price, in fact you can consider 'Market Order' as limit order with
This difference here is this is pure limit order driven, i.e. 'Market Order' is considered as limit order with limit price higher or lower than current market price, in fact you can consider 'Market Order' as limit order with 'inf' limit price, and the priority of all market order is automatically maintained in heaps because of the way Order book read from OrderQueue and put into PriorityQueue.
The four heaps structure is simplified into two heaps structure, one for 'BUY' and one for 'SELL'.
The PriorityQueue is rewritten to make it Log(N) instead of N, but this makes trivial difference in this context since Heaps normally has <1000 orders.
In fact using Matlab timer function and attach one to each agent is not the ideal structure to simulate the real market, which allows 1) both time driven and event driven processing & 2) parallel processing for traders and exchange. I have tried to do multi-threading in Matlab, but apparently it is not supported.
We are currently writing a multi-threading version in java. I also wrote a more flexible simulation framework using Swarm(a multi-agent simulation library) dynamic scheduling engine in JAVA. The ultimate goal is to achieve arbitrarily realistic market simulation, allowing multiple exchange routing, multiple order books, FIX protocol, simulation of latency impact etc.
System Requirements:MATLAB 7.9 (2009b)
Program Release Status: New Release
Program Install Support: Install and Uninstall