All Projects → hanxixuana → flowrisk

hanxixuana / flowrisk

Licence: MIT license
A Python Implementation of Measures for Order Flow Risk, e.g. VPIN

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to flowrisk

evaluator
⚖Open Source Toolkit for Quantitative Risk Assessment
Stars: ✭ 120 (+126.42%)
Mutual labels:  risk
toxicity
The world's largest social media toxicity dataset.
Stars: ✭ 135 (+154.72%)
Mutual labels:  toxicity
DRIP
Fixed Income Analytics, Portfolio Construction Analytics, Transaction Cost Analytics, Counter Party Analytics, Asset Backed Analytics
Stars: ✭ 44 (-16.98%)
Mutual labels:  risk
conexp-clj
A General-Purpose Tool for Formal Concept Analysis
Stars: ✭ 37 (-30.19%)
Mutual labels:  order
Food-Order
Food ordering template application using Ionic, Angular and Typescript.
Stars: ✭ 20 (-62.26%)
Mutual labels:  order
node-bitstamp
bitstamp REST and WS API Node.js client 💵
Stars: ✭ 58 (+9.43%)
Mutual labels:  order
RiskInDroid
A tool for quantitative risk analysis of Android applications based on machine learning techniques
Stars: ✭ 69 (+30.19%)
Mutual labels:  risk
cas
Cellular Automata Simulator
Stars: ✭ 22 (-58.49%)
Mutual labels:  order
TriFlow
TriFlow: Triaging Android Applications using Speculative Information Flows
Stars: ✭ 12 (-77.36%)
Mutual labels:  risk
OrderSystem
An independent micro-service that takes orders in and processes payments.
Stars: ✭ 16 (-69.81%)
Mutual labels:  order
Orca
Advanced Malware with multifeatures written in ASM/C/C++ , work on all windows versions ! (uncompleted)
Stars: ✭ 184 (+247.17%)
Mutual labels:  risk
market risk gan tensorflow
Using Bidirectional Generative Adversarial Networks to estimate Value-at-Risk for Market Risk Management using TensorFlow.
Stars: ✭ 63 (+18.87%)
Mutual labels:  risk
alphabetical-sorter
VScode extension - For variable alphabetical re-order
Stars: ✭ 30 (-43.4%)
Mutual labels:  order
social-data
Code and data for eviction and housing analysis in the US
Stars: ✭ 17 (-67.92%)
Mutual labels:  risk
next
(Work in progress) The rewritten version of the original PizzaQL 🍕
Stars: ✭ 45 (-15.09%)
Mutual labels:  order
risk
A game of Risk played on a hexgrid.
Stars: ✭ 95 (+79.25%)
Mutual labels:  risk
DLL-INJECTOR
I created a dll injector I am going to Open source its Code. But remember one thing that is any one can use it only for Educational purpose .I again say do not use it to damage anyone's Computer.But one thing if you are using it for some good purpose like to help someone who really need help then I permit you to use it.
Stars: ✭ 14 (-73.58%)
Mutual labels:  risk
awesome-risks
Sample Risks for a Software Project
Stars: ✭ 36 (-32.08%)
Mutual labels:  risk
wp-tag-order
↕︎ Sort tags manually in individual posts (not site-globally) on WordPress.
Stars: ✭ 16 (-69.81%)
Mutual labels:  order
simple-page-ordering
Order your pages and other hierarchical post types with simple drag and drop right from the standard page list.
Stars: ✭ 88 (+66.04%)
Mutual labels:  order

Order Flow Risk Measures

Has been updated to support Python 3.8. Currently, the packages only has VPIN.

Installation

The default way is to open a console and execute

pip install flowrisk

One may also download from here and manually install

git clone https://github.com/hanxixuana/flowrisk
cd flowrisk
python setup.py install

VPIN

To implement VPIN, we made

1.  an EWMA estimator of volatility (RecursiveEWMAVol)
2.  a numpy.ndarray based buckets with bulk classification of volumes in the MA style (RecursiveBulkClassMABuckets)
3.  a numpy.ndarray based buckets with bulk classification of volumes in the EWMA style 
    (RecursiveBulkClassEWMABuckets)
4.  a recursive VPIN estimator (RecursiveVPIN)
5.  a recursive VPIN estimator with VPIN confidence intervals (RecursiveConfVPIN)
6.  a recursive model using an EWMA estimator of means and RecursiveEWMAVol, for modeling and log 
    innovations of VPINs and for calculating VPINs' confidence intervals (RecursiveEWMABand)
7.  a one-shoot VPIN estimator for a series of prices (BulkVPIN)
8.  a one-shoot VPIN estimator for a series of prices with VPIN confidence intervals (BulkConfVPIN)
9.  various configuration classes (RecursiveVPINConfig, RecursiveConfVPINConfig, BulkVPINConfig, 
    BulkConfVPINConfig)

For illustration, we also put the 1-min data of five small caps (CBIO, FBNC, GNC NDLS, QES) and five large caps (V, AAPL, NVDA, GS, INTC) from the US stock market. The data covers Nov 12 to Nov 21, 2018. The data can used by, for example,

import flowrisk as fr

class Config(fr.BulkConfVPINConfig):    
    N_TIME_BAR_FOR_INITIALIZATION = 50

config = Config()

example = fr.examples.USStocks(config)
symbols = example.list_symbols('small')
result = example.estimate_vpin_and_conf_interval(symbols[0])

example.draw_price_vpins_and_conf_intervals()

The piece of the code will automatically calculate VPINs and associated confidence intervals of GNC. We also put prices and volumes together with them into a nice picture, which is saved to ./pics/gnc.png by default. Note that the calculation of VPINs is fast, but making nice pictures is slow. One may also find out more in order_flow_risk_analysis_of_ten_us_stocks.ipynb and test.py.

Note that there are several differences between this implementation and the original paper:

Easley, D., López de Prado, M. M., & O'Hara, M. (2012). Flow toxicity and liquidity in a high-frequency world. 
The Review of Financial Studies, 25(5), 1457-1493.

For example,

1.  we use an EWMA estimator for the volatility of PnLs, instead of using all samples for estimating the PnL 
    volatility; and
2.  VPINs are calculated from the very beginning, instead of after a certain number of buckets have been filled.

We made the differences because the core of our package is a recursive estimator of VPIN.

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].