Code Monkey home page Code Monkey logo

pyziabm's Introduction

pyziabm

Zero Intelligence Agent-Based Model of Modern Limit Order Book

Charles Collver, PhD

See the Project Website for more details and radicalmarketsimulation for a more general discussion of applying agent-based modeling to financial markets.

If you just want to install and run a quick simulation: conda install -c dennycrane pyziabm

In a Jupyter Notebook or iPython command line:

import pyziabm as pzi

pzi.Runner()

will call the simulation with the defaults. To change the defaults and run several in a loop see the runwrapper files detailed below. To keep all of the data from one simulation in memory, assign to a variable:

sim1 = pzi.Runner()

There are seven files:

  1. orderbook3.py
  2. trader2017_r3.py
  3. runner2017mpi_r3.py
  4. runner2017mpi_r4.py
  5. runwrapper2017mpi_r3.py
  6. runwrapper2017mpi_r3x.py
  7. runwrapper2017mpi_r4.py

orderbook3.py

  • Contains the Orderbook class.
  • Instances track, process and match orders.
  • Imported by runner2017mpi_r3.py.

trader2017_r3.py

  • Contains the base ZITrader class and six subclasses: PennyJumper, Taker, Provider, Provider5, MarketMaker, MarketMaker5.
  • There is also an InformedTrader, but it is yet unimplemented. See pyziabmc for more details.
  • Imported by runner2017mpi_r3.py and runner2017mpi_r4.py.

runner2017mpi_r3.py and runner2017mpi_r4.py

  • Contains the Runner class.
  • Instances set up and run 1 simulation.
  • Note: the __init__() in runner2017mpi_r3.py uses all keywords - these are the defaults. User can change them here or override them when instantiating in __main__().
  • Note: User should specify proper paths for saving output.
  • Imported by runwrapper2017mpi_r3.py or runwrapper2017mpi_r4.py.

runwrapper2017mpi_r3.py and runwrapper2017mpi_r4.py

  • Runs the simulations in a loop, does some summary output bookkeeping.
  • Note: User should specify proper paths for saving output.

runwrapper2017mpi_r3x.py

  • An example of a Unix executable version of runwrapper2017mpi_r3.py.
  • Note: User should specify proper paths for the python executable and saving output.

There are two test files:

  1. testOrderbook3.py
  2. testTrader2017_r3.py

There are several Jupyter Notebooks that should work with minimal changes to the directories.

Written and tested with Python3.6

pyziabm's People

Contributors

jackbenny39 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

Watchers

 avatar  avatar  avatar  avatar  avatar

pyziabm's Issues

Very Basic Question!

Hi, I'm pretty new to python, but I have really been learning alot about coding a simple limit order book in python. What I really wanted to know is how do I use your code to actually obtain an output.

I have the historical quotes and trades data for the NYSE for a large batch of stocks so i'm pretty sure I have the correct data to run the code.

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.