- Notifications
You must be signed in to change notification settings - Fork4
visualize financial microstructure 📈 & debug trading bots 🤖
License
will-thompson-k/microstructure-plotter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
For those of you in the trenches, I offer ye this tool ⚔️
This is a plotting tool designed to help visualize financial market data 📈 and trading system behavior 🤖 on the smallest timescales 🔎.
As all things in life, when it comes to financial microstructure:the devil 😈 is in the details
Built usingChaco 🌮
See theillustrated example for a deep dive into what this plotting tool can uncover 🔎.
⚠️ Disclaimer- ✨Features
- 🧠Illustrated Example
- 🧪Test It Out Right Now
- 🗺️Plots Legend
- 💸Free Advice
- ✏️Data Schema
- 🤔What is "Market Microstructure"?
- 🛞Installation
- 📜Reqs
- 𓊍To Do
- Citation
- License
There is no α here. This is just a fancy wrapper on top of an open-source plotting package.
You shouldB.Y.O.A (Bring Your Own Alpha).
However...for the trained eye 👁️, this simple type of visualization can be immensely helpful.
Here are some useful features to take note of 🥁:
- ✨Plotmultiple 🤹, asynchronous (unsampled) microstructure elements together onthe sample plot:order book quotes,trades,orders,order acks,fills etc etc
- ✨Analyze events on seconds, milliseconds, microseconds,nanoseconds 🕳️ : zoom 🔎 in on themost granular time unit available to microstructure behavior
- ✨All axes are 🔗linked : 🔎zoom in on one product, see what's happening in all others at that same timestamp
To show why a tool like this might be useful,here is an example motivated from things seen in the wild.
Note: This data was painstakingly createdby hand 🤌 to appear quasi-realistic. I am not an artist 🧑🎨 nor is this real 🌎 data.
See thelegend 👇 to understand the plots further.
After installing the package either viapip or viasetup.py, run this quick line to see this in action right now:
bash examples/example_1/plot_example.sh
or
python examples/example_1/plot_example.py
Right-click 🖱️ to zoom in on different parts of the plot to see what is happening onsmaller andsmaller timescales 🔎. Consult thelegend orillustrated example for more clarity on how to interpret the plots.
Here is a complete legend of everything the plotter can visualize.
- Don't log in prod ✏️ (unless logging isn't occuring on the hot path).
- Make sure the timestamps are from ⏰synchronized clocks ⏰ (better if geosync'd/GPS) with enough precision, otherwise these plots will be uninformative or misleading. If you don't trust others' timestamps, do your own capture.
- This plotter ismemory intensive 🧠. Don't try to plot too much at once.
This plotting module expects a specificdata schema.
For the uninitiated, here is a⏰ 30 second primer ⏰ on market microstructure.
You can install the repo using pip directly:
pip install git+https://github.com/will-thompson-k/microstructure-plotter
Alternatively you can use the setup.py.
Python 3.7+ recommended.
Here are the package requirements (found in requirements.txt)
- chaco==5.1.0
- enable==5.3.1
- traits==6.4.1
- traitsui==7.4.2
- pandas==1.3.5
- pyqt
- add more order types: modifies, equity order types, etc.
- add "decision boundary" of model: bid/ask edges, etc.
- unit tests
@misc{microstructure-plotter,author= {Thompson,Will},url= {https://github.com/will-thompson-k/microstructure-plotter},year= {2023}}
MIT
About
visualize financial microstructure 📈 & debug trading bots 🤖
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.