All Projects → lebedov → nseindia_lob

lebedov / nseindia_lob

Licence: other
National Stock Exchange of India Limit Order Book Simulation

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to nseindia lob

Black-Scholes-Option-Pricing-Model
Black Scholes Option Pricing calculator with Greeks and implied volatility computations. Geometric Brownian Motion simulator with payoff value diagram and volatility smile plots. Java GUI.
Stars: ✭ 25 (+0%)
Mutual labels:  simulation
QuadrotorFly
This is a dynamic simulation for quadrotor UAV
Stars: ✭ 61 (+144%)
Mutual labels:  simulation
AutoInteraction-Library
Android仿真人机交互开源库,包括自动化模拟点击指定控件、模拟滚屏等
Stars: ✭ 50 (+100%)
Mutual labels:  simulation
osparc-simcore
osparc-simcore simulation framework
Stars: ✭ 18 (-28%)
Mutual labels:  simulation
Stocksent
A Python library for sentiment analysis of various tickers from the latest news by trusted sources, and tools to plot results. 📈📊📰
Stars: ✭ 35 (+40%)
Mutual labels:  stock-market
qecsim
qecsim is a Python 3 package for simulating quantum error correction using stabilizer codes.
Stars: ✭ 34 (+36%)
Mutual labels:  simulation
mdtoolbox
MDToolbox: A MATLAB/Octave toolbox for statistical analysis of molecular dynamics trajectories
Stars: ✭ 21 (-16%)
Mutual labels:  simulation
FLAMEGPU2
FLAME GPU 2 is a GPU accelerated agent based modelling framework for C++ and Python
Stars: ✭ 25 (+0%)
Mutual labels:  simulation
ls1-mardyn
ls1-MarDyn is a massively parallel Molecular Dynamics (MD) code for large systems. Its main target is the simulation of thermodynamics and nanofluidics. ls1-MarDyn is designed with a focus on performance and easy extensibility.
Stars: ✭ 17 (-32%)
Mutual labels:  simulation
PFL-Non-IID
The origin of the Non-IID phenomenon is the personalization of users, who generate the Non-IID data. With Non-IID (Not Independent and Identically Distributed) issues existing in the federated learning setting, a myriad of approaches has been proposed to crack this hard nut. In contrast, the personalized federated learning may take the advantage…
Stars: ✭ 58 (+132%)
Mutual labels:  simulation
dalal-street-server
Server for Pragyan's Dalal Street
Stars: ✭ 65 (+160%)
Mutual labels:  stock-market
data-science-notes
Open-source project hosted at https://makeuseofdata.com to crowdsource a robust collection of notes related to data science (math, visualization, modeling, etc)
Stars: ✭ 52 (+108%)
Mutual labels:  simulation
sycomore
MRI simulation toolkit
Stars: ✭ 13 (-48%)
Mutual labels:  simulation
voting
A simulator for voting systems.
Stars: ✭ 24 (-4%)
Mutual labels:  simulation
mbsim
A multi-body simulation software
Stars: ✭ 22 (-12%)
Mutual labels:  simulation
pypuf
Cryptanalysis of Physically Unclonable Functions
Stars: ✭ 39 (+56%)
Mutual labels:  simulation
orbital-sim
A simple physics engine build over a PyGame simulation to accurately model planetary orbits in space
Stars: ✭ 31 (+24%)
Mutual labels:  simulation
streamdeck-stockticker
Stock Ticker plugin for Stream Deck
Stars: ✭ 29 (+16%)
Mutual labels:  stock-market
keeperfx
Open source remake and Fan Expansion of Dungeon Keeper.
Stars: ✭ 128 (+412%)
Mutual labels:  simulation
Evagents
A "Natural" Selection Simulator using Neural Nets
Stars: ✭ 19 (-24%)
Mutual labels:  simulation

National Stock Exchange of India Limit Order Book Simulation

This package implements a limit order book that simulates the processing of limit/market orders on India's National Stock Exchange (NSE).

Requirements

The code requires the following software for installation (older versions may work, but haven't been tested):

Installation

Build the extension by running:

python setup.py build_ext --inplace

Running the Simulation

To run the simulation, invoke the simulation script with a specified firm name, output directory, and list of input files. For example:

python lob.py INCI ./output INCI-orders-03092013.csv.gz INCI-orders-03102013.csv.gz

A sample data file (EXAMPLE-orders.csv) is included. A script for launching the code on a Sun Grid Engine cluster is also included; the script requires the drmaa-python package. To use the script, replace the listed security names accordingly.

Input File Format

The simulation requires input files in CSV format comprising the following columns with the indicated byte lengths. The input file may be compressed with gzip.

record indicator (2)
Ignored.
segment (4)
Ignored.
order number (16)
8 left-most digits are date YYYYMMDD, followed by 00000001-99999999.
transaction date (10)
MM/DD/YYYY
transaction time (14)
HH:MM:SS.XXXXXX, where XXXXXX is microseconds.
buy/sell indicator (1)
Must be either 'B' or 'S'.
activity type (1)
Must be 1 (order add), 3, (order cancel), or 4 (order modify).
symbol (10)
Firm identifier.
instrument (6)
Ignored.
expiry date (10)
MM/DD/YYYY
strike price (variable)
Integer.
option type (2)
Ignored.
volume disclosed (variable)
Integer.
volume original (variable)
Integer.
limit price (variable)
Float.
trigger price (variable)
Float.
market flag (1)
'Y' for market order, 'N' for limit order.
stop loss flag (1)
'Y' for stop loss order, 'N' for regular lot order.
Immediate-or-Cancel (IOC) flag (1)
'Y' for IOC, 'N' for non-IOC.
spread/combination type (1)
Ignored.
algo indicator (1)
Ignored.
client identity flag (1)
Ignored.

Methodology and Implementation

The limit order book is implemented as two red-black trees of queues corresponding to different buy and sell price levels. The use of red-black trees accelerates determination of the bid and ask prices at any step of the simulation. Further acceleration is achieved by compiling the simulation with Cython.

Order processing is restricted to the orders with the first futures expiration date observed during processing; all other orders are ignored.

Submitted orders may be add requests, modification requests, or cancellation requests. Both market and limit orders are supported; during processing, the former are discarded if they fail to match any orders already in the book. Residual volume for IOC orders is discarded. Orders that have explicitly disclosed (i.e., non-zero) volumes are assumed to be hidden; if any such orders in a price level queue, they are matched against a new incoming order AFTER orders with zero disclosed volume.

Daily stats are accumulated during the simulation and are reset when the date associated with the processed orders changes.

Author

The code was written by Lev Givon in 2012-2013 for Prof. Costis Maglaras at Columbia Unversity's Business School.

License

See included LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].