Code Monkey home page Code Monkey logo

pyobsim's Introduction

Build Status

PyOBSim - the Python Order Book Simulator


PyOBSim is a Python module facilitating market simulation by implementing an order book and other utilities. PyOBSim aims to make testing of trading algorithms clean and simple.

Running simulations is straightforward: simply provide an order flow and fire away:

from pyobsim import *

# build our participants
alice = participant.Participant("Alice", 100, 0)    # $100, no units
bob = participant.Participant("Bob", 0, 120)        # $0, 120 units

sim = simulation.Simulation("My Simulation", [], [alice, bob])
sim.load("order_flow.csv") # load our order flow from CSV file
sim.run()
print(sim)

This gives us our summary:

Simulation 
    My Simulation
---
Statement of Accounts
Alice: $100.0 with 0 units
Bob: $0.0 with 120 units
---
Market as at present
     'GOOG'

If we want to inspect the book for GOOG:

print(sim.books["GOOG"])

We get:

Book for GOOG
Spread is $0.5
===
Ask
Price		Quantity
--------------------------------------------------------------------------------
$1.0		100	|
			    |$0.5		10
--------------------------------------------------------------------------------
			     Price		Quantity
			     Bid    

pyobsim's People

Contributors

hetra avatar jmcph4 avatar

Stargazers

 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

pyobsim's Issues

How Do I Contact You

Hi!

I found your project recently and I was wondering about how I could contact you. One of the things I want to do 2019 is create a full super multi-agent market simulator.

I figure creating the simulator would be difficult but powerful over-time if we have reinforcement learning to try learning from repeated simulations.

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.