Hi everyone,
on a daily basis i need to travel a lot. So to overcome the time in the
train i implemented a zero-intelligence model of agents in kdb+/q to
simulate a limit order book.
Actually i took the thesis ASYNCHRONOUS SIMULATIONS OF A LIMIT ORDER
BOOK from Gilles Daniel and implemented the algorithm 1 in kdb+/q.
Now all the code is uploaded on the contribution site of kx.
http://code.kx.com/wsvn/code/contrib/kuentang/zia/
If you want give it a try you need to start 3 q processes using the
following lines:
C:\q\w32\q.exe qx.q -p 2009
C:\q\w32\q.exe zia.q -p 2010
q) \t 100
q) obk
C:\q\w32\q.exe user.q -p 2011
The first q process is there to act as an exchange. The implementation
is inspired from the site gbkr.com.
The second one is the implementation of the zero-intelligence model of
agents.
The last one gives you the opportunity to interact with the exchange
If you have questions, comments or even ideas to improve it, please feel
free to reply.
Why did you do it?
Please read the beginning again. Moreover using the zia i believe you
can measure the market impact of your strategy. This is something that
you cant backtest with historical data.
As you said there is already an implementation from Gordon Baker of an
exchange. Why did you implement it again?
Actually in the beginning i implemented the zia on top of the code from
Gordon Baker. But later on i want to try the idea of using a finite
state machine to build an exchange. So that's why i reimplemented it
using the fsm.
What is a finite state machine?
You can google it.
Regards,
Kim