Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Smart Order Flow Visualizer

A desktop order-flow terminal for MetaTrader 5. It takes a live depth-of-market feed and renders the two views tape readers actually work from — a volume heat map of the book and a time-and-sales tape — with an alert engine watching for the events you would otherwise have to catch by eye.

Built with PySide6 and pyqtgraph, so the plotting runs natively rather than in an embedded browser.

What it shows

Market depth heat map — bid and ask volume at every price level, coloured by size, updating on a configurable interval (50 ms by default, up to 20 levels either side of the mid). The colour scheme, scaling and price precision are all configurable.

Tape reader — real-time trade executions as a time-and-sales panel, with filtering and highlighting so large prints stand out from the noise.

Alerts — four conditions, each with its own thresholds and priority:

Alert Fires on
Large trade A single execution above a size threshold
Volume spike Traded volume jumping against its recent baseline
Price movement A move beyond a configured distance in a window
Liquidity imbalance Bid and ask depth diverging past a ratio

Alerts can raise an audible notification as well as an on-screen one.

How it is put together

MetaTrader 5  →  mt5_connector  →  data_broker  →  heat map widget
                                        │            tape reader widget
                                        │            alert system
                                        └────────→   data_logger (SQLite)
  • core/mt5_connector.py — connection, symbol subscription, reconnection.
  • core/data_broker.py — the central async hub. Every UI component subscribes here rather than polling the terminal, so one feed serves the whole window.
  • core/data_processor.py — turns raw ticks and depth snapshots into the aggregates the widgets draw.
  • core/alert_system.py — evaluates conditions against each update.
  • core/data_logger.py — SQLite persistence for ticks and depth, so a session can be replayed or analysed after the fact.
  • config/settings.py — dataclass-backed configuration with YAML/JSON persistence, covering connection, display and data-retention settings.
  • models/tick_data, market_depth and alert_config types shared across the layers.

Requirements

  • Windows. The official MetaTrader5 Python package is Windows-only, and the terminal itself has to be installed and logged in.
  • Python 3, with the packages in requirements.txt (PySide6, pyqtgraph, numpy, pandas, MetaTrader5, pygame for audio alerts).

Running it

pip install -r requirements.txt
python main.py

Connection details go in the settings dialog, or directly into the config file under MT5Config — server, login, and whether to connect on launch.

launcher_minimal.py starts a reduced window, which is useful for checking a connection without the full layout.

Tests

python -m pytest tests/

Covers the data processor, the heat map widget and the MT5 connector.

Scope

This is a visualisation and alerting tool. It reads from MetaTrader 5 and it does not place, modify or cancel orders — there is no execution path in the codebase at all.

About

Desktop order-flow terminal in PySide6: live MetaTrader 5 depth feed, volume heat map, tape reader and configurable price and volume alerts.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages