mahmoud20138
OrderFlow-Analysis-Pro
Python

Order flow analysis with Bybit + MT5 feeds -- footprint charts, delta analytics, volume profile, pattern detection, Dash dashboard with WebSocket

Last updated Jul 9, 2026
19
Stars
6
Forks
0
Issues
+2
Stars/day
Attention Score
58
Language breakdown
Python 63.7%
JavaScript 31.5%
CSS 3.6%
HTML 1.2%
โ–ธ Files click to expand
README

OrderFlow Analysis Pro

Real-time orderflow trading system โ€” tick-level microstructure analysis, 5 pattern detectors, volume profile framing, state machine trade lifecycle, dual data feeds (MT5 + Bybit), FastAPI dashboard with WebSocket, Telegram alerts. Built on Fabio Testa's methodology.

Python License Instruments Lines API


Table of Contents


What Is OrderFlow Analysis?

OrderFlow analysis reads market microstructure โ€” the tick-by-tick footprint of buyers and sellers โ€” to understand who is in control before price reflects it. Unlike traditional technical analysis that looks at candles and indicators, orderflow looks inside the candle:

Traditional Analysis              OrderFlow Analysis
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€             โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Looks at: OHLC candles             Looks at: Every tick (price + volume + side)
Timeframe: 1m, 5m, 1H             Timeframe: Tick-level (milliseconds)
Answers: What happened?            Answers: WHO did it and WHY?
Indicators: RSI, MACD, MA         Engines: Delta, Footprint, Volume Profile, Orderbook
Lagging: Yes (averages)            Leading: No (real-time microstructure)

Key Concepts

| Concept | What It Measures | Why It Matters | |---------|-----------------|----------------| | Delta | Buy volume minus sell volume per candle/level | Who is aggressive โ€” buyers or sellers? | | Cumulative Delta | Running total of delta over time | Is buying/selling pressure building or fading? | | Footprint | Volume at each price level split by bid/ask | Where did the heavy trading happen inside the candle? | | Volume Profile | Total volume traded at each price over a session | Where is the "fair value" โ€” POC, VAH, VAL? | | Orderbook | Limit orders waiting at each price level | Where are the walls? Thin levels = easy to sweep. | | Absorption | Aggressive volume with no price movement | Someone is defending a level with limit orders. | | Initiative | Aggressive volume WITH price movement | Institutional conviction pushing price. |


System Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                         OrderFlow Analysis Pro                              โ”‚
โ”‚                                                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”      โ”‚
โ”‚  โ”‚   DATA SOURCES       โ”‚     โ”‚   ANALYTICS ENGINES (per instrument) โ”‚      โ”‚
โ”‚  โ”‚                      โ”‚     โ”‚                                      โ”‚      โ”‚
โ”‚  โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚     โ”‚  Volume Profile  โ”€โ”€ POC, VAH, VAL,  โ”‚      โ”‚
โ”‚  โ”‚  โ”‚  MT5   โ”‚ โ”‚Bybit โ”‚ โ”‚โ”€โ”€โ”€โ”€โ–ถโ”‚  Delta Engine    โ”€โ”€ vertical, horiz,โ”‚      โ”‚
โ”‚  โ”‚  โ”‚  Feed  โ”‚ โ”‚ Feed โ”‚ โ”‚     โ”‚  Footprint       โ”€โ”€ bid/ask/level,  โ”‚      โ”‚
โ”‚  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚     โ”‚  Orderbook       โ”€โ”€ L2 depth, thin  โ”‚      โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜      โ”‚
โ”‚                                               โ”‚                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚                    5 PATTERN DETECTORS                                 โ”‚  โ”‚
โ”‚  โ”‚  Absorption ยท Initiative ยท Sweep ยท Exhaustion ยท Divergence            โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚                                               โ”‚                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚                    SIGNAL PROCESSING                                   โ”‚  โ”‚
โ”‚  โ”‚  Profile Framing (P/b/D shapes) โ†’ Qualified Levels โ†’ Daily Bias      โ”‚  โ”‚
โ”‚  โ”‚  Signal Aggregator (state machine) โ†’ Composite Score (0-100)         โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚               โ”‚                                  โ”‚                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚   Telegram Alerts     โ”‚  โ”‚   FastAPI Dashboard                    โ”‚     โ”‚
โ”‚  โ”‚   Entry/BE/Trail/Exit โ”‚  โ”‚   16 REST endpoints + WebSocket        โ”‚     โ”‚
โ”‚  โ”‚   Daily Bias updates  โ”‚  โ”‚   Charts, VP, Footprint, Orderbook     โ”‚     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚   Scanner, Strategy Status, Tape       โ”‚     โ”‚
โ”‚                              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”     โ”‚
โ”‚  โ”‚   SQLite Database (WAL mode)                                       โ”‚     โ”‚
โ”‚  โ”‚   ticks ยท candles ยท volumeprofiles ยท signals ยท tradejournal     โ”‚     โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜     โ”‚
โ”‚                                                                             โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Architecture

Data Flow Pipeline

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                     โ”‚  MT5 Feed   โ”‚โ”€โ”€โ”€โ”€ Tick polling (100ms)
                     โ”‚  (495L)     โ”‚โ”€โ”€โ”€โ”€ Market Book (DOM)
                     โ”‚             โ”‚โ”€โ”€โ”€โ”€ Historical download
                     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”       โ”‚       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚  Bybit Feed  โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค       โ”‚   Database   โ”‚
     โ”‚  (209L)      โ”‚       โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚  (278L)      โ”‚
     โ”‚  WebSocket   โ”‚       โ”‚       โ”‚  SQLite WAL  โ”‚
     โ”‚  Free, no keyโ”‚       โ”‚       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜       โ”‚
                            โ–ผ
                   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                   โ”‚ Candle Builder  โ”‚ โ† Tick โ†’ 1m aggregation
                   โ”‚ (133L)          โ”‚ โ† Footprint per level
                   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                            โ”‚
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ–ผ             โ–ผ              โ–ผ
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚ Volume Prof. โ”‚ โ”‚  Delta   โ”‚ โ”‚  Footprint   โ”‚
     โ”‚ Engine (258L)โ”‚ โ”‚Engine    โ”‚ โ”‚  Engine      โ”‚
     โ”‚              โ”‚ โ”‚ (197L)   โ”‚ โ”‚ (181L)       โ”‚
     โ”‚ POC/VAH/VAL  โ”‚ โ”‚ Vert/Horโ”‚ โ”‚ Bid/Ask/Lvl  โ”‚
     โ”‚ LVN/Shape    โ”‚ โ”‚ Cumul.   โ”‚ โ”‚ Imbalance    โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
            โ”‚              โ”‚              โ”‚
            โ–ผ              โ–ผ              โ–ผ
     โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
     โ”‚        ORDERBOOK TRACKER (208L)          โ”‚
     โ”‚  L2 depth ยท Thin levels ยท Consumptions  โ”‚
     โ”‚  Path of least resistance               โ”‚
     โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚
        โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
        โ–ผ       โ–ผ       โ–ผ       โ–ผ       โ–ผ       โ”‚
   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
   โ”‚Absorp- โ”‚โ”‚Initia- โ”‚โ”‚Sweep โ”‚โ”‚Exhaus- โ”‚โ”‚Diverg- โ”‚
   โ”‚tion    โ”‚โ”‚tive    โ”‚โ”‚      โ”‚โ”‚tion    โ”‚โ”‚ence    โ”‚
   โ”‚(257L)  โ”‚โ”‚(133L)  โ”‚โ”‚(142L)โ”‚โ”‚(228L)  โ”‚โ”‚(159L)  โ”‚
   โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”ฌโ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜โ””โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”˜
       โ”‚         โ”‚        โ”‚        โ”‚         โ”‚
       โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ–ผ
            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
            โ”‚  Profile Framing    โ”‚ โ† P/b/D shape โ†’ Daily Bias
            โ”‚  (343L)             โ”‚ โ† Qualified Levels (VAH/VAL/POC/LVN/Merged)
            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                      โ–ผ
            โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
            โ”‚  Signal Aggregator  โ”‚ โ† State machine (6 states)
            โ”‚  (516L)             โ”‚ โ† Composite scoring (0-100)
            โ”‚                     โ”‚ โ† SL/TP calculation
            โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                   โ”‚
       โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
       โ–ผ           โ–ผ               โ–ผ
 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
 โ”‚ Telegram โ”‚ โ”‚Dashboard โ”‚  โ”‚  Database     โ”‚
 โ”‚ Bot      โ”‚ โ”‚ FastAPI  โ”‚  โ”‚  Journal      โ”‚
 โ”‚ (202L)   โ”‚ โ”‚ (1015L)  โ”‚  โ”‚  Logging      โ”‚
 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Module Dependency Graph

main.py (666L) โ”€โ”€โ”€ System orchestrator
    โ”‚
    โ”œโ”€โ”€ config/settings.py (946L) โ”€โ”€โ”€ 29 instrument configs, 10 config dataclasses
    โ”‚
    โ”œโ”€โ”€ data/
    โ”‚   โ”œโ”€โ”€ models.py (290L) โ”€โ”€โ”€ 7 dataclasses: Tick, Candle, Signal, TradeState...
    โ”‚   โ”œโ”€โ”€ candle_builder.py (133L) โ”€โ”€โ”€ Tick โ†’ 1m aggregation + footprint
    โ”‚   โ”œโ”€โ”€ mt5_feed.py (495L) โ”€โ”€โ”€ MT5 terminal: ticks, book, history
    โ”‚   โ”œโ”€โ”€ bybit_feed.py (209L) โ”€โ”€โ”€ Bybit WebSocket: trades + orderbook
    โ”‚   โ””โ”€โ”€ database.py (278L) โ”€โ”€โ”€ SQLite: 5 tables, WAL mode
    โ”‚
    โ”œโ”€โ”€ analytics/
    โ”‚   โ”œโ”€โ”€ volume_profile.py (258L) โ”€โ”€โ”€ POC/VAH/VAL/LVN/shape
    โ”‚   โ”œโ”€โ”€ delta.py (197L) โ”€โ”€โ”€ Vertical + horizontal + cumulative delta
    โ”‚   โ”œโ”€โ”€ footprint.py (181L) โ”€โ”€โ”€ Bid/ask per level, imbalance detection
    โ”‚   โ””โ”€โ”€ orderbook.py (208L) โ”€โ”€โ”€ L2 depth, thin levels, consumption tracking
    โ”‚
    โ”œโ”€โ”€ patterns/
    โ”‚   โ”œโ”€โ”€ absorption.py (257L) โ”€โ”€โ”€ Effort >> result detection
    โ”‚   โ”œโ”€โ”€ initiative.py (133L) โ”€โ”€โ”€ Effort = result (momentum)
    โ”‚   โ”œโ”€โ”€ sweep.py (142L) โ”€โ”€โ”€ Thin book displacement
    โ”‚   โ”œโ”€โ”€ exhaustion.py (228L) โ”€โ”€โ”€ Declining volume at extremes
    โ”‚   โ””โ”€โ”€ divergence.py (159L) โ”€โ”€โ”€ Price vs delta disagreement
    โ”‚
    โ”œโ”€โ”€ signals/
    โ”‚   โ”œโ”€โ”€ profile_framing.py (343L) โ”€โ”€โ”€ Daily bias + qualified levels
    โ”‚   โ””โ”€โ”€ aggregator.py (516L) โ”€โ”€โ”€ State machine + composite scoring
    โ”‚
    โ”œโ”€โ”€ alerts/
    โ”‚   โ””โ”€โ”€ telegram_bot.py (202L) โ”€โ”€โ”€ Telegram notifications
    โ”‚
    โ””โ”€โ”€ dashboard/
        โ”œโ”€โ”€ app.py (1015L) โ”€โ”€โ”€ FastAPI REST + WebSocket server
        โ”œโ”€โ”€ websocket_manager.py (186L) โ”€โ”€โ”€ 9-channel broadcast with throttling
        โ”œโ”€โ”€ demo_data.py (782L) โ”€โ”€โ”€ Deterministic demo data generator
        โ”œโ”€โ”€ main.py (35L) โ”€โ”€โ”€ Standalone launcher
        โ””โ”€โ”€ static/ โ”€โ”€โ”€ HTML/JS/CSS frontend (8 files, 4,420L)

The 5 Core Patterns

The system detects 5 microstructure patterns based on Fabio Testa's methodology. Each outputs a strength score (0-100) and directional bias (BUY/SELL).

Pattern Overview

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     5 PATTERN DETECTORS                             โ”‚
โ”‚                                                                     โ”‚
โ”‚  1. ABSORPTION        2. INITIATIVE       3. SWEEP                  โ”‚
โ”‚  Effort >> Result     Effort = Result     Thin Book Displacement    โ”‚
โ”‚  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ           โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ          โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ                    โ”‚
โ”‚  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  (no      โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ  (price  โ–ˆโ–ˆโ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ (price          โ”‚
โ”‚  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   move)   โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ   moves) โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘   moves fast)   โ”‚
โ”‚  Buyers/Sellers       Directional         Low volume                โ”‚
โ”‚  defending level      conviction          through empty levels      โ”‚
โ”‚                                                                     โ”‚
โ”‚  4. EXHAUSTION        5. DIVERGENCE                                 โ”‚
โ”‚  Declining Effort     Price vs Delta Disagreement                   โ”‚
โ”‚  โ–ˆโ–ˆ  โ–ˆ  โ–ˆ            Price: โ†—โ†—โ†— NEW HIGH                            โ”‚
โ”‚  โ–ˆ  โ–ˆ  โ–“             Delta: โ†—โ†—โ†˜  (failing)                         โ”‚
โ”‚  โ–ˆ  โ–“  โ–‘             Trend reversal warning                        โ”‚
โ”‚  โ–“  โ–‘  โ–‘                                                           โ”‚
โ”‚  Volume fading                                                     โ”‚
โ”‚  at extremes                                                       โ”‚
โ”‚                                                                     โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Detection Details

| # | Pattern | Detection Logic | Source Data | Signal Purpose | |---|---------|----------------|-------------|----------------| | 1 | Absorption | 2 methods: (a) Delta/price mismatch โ€” positive delta + red candle = sellers absorbing, (b) High volume at level + low displacement + repeated attempts | Delta, Footprint, Price | Entry signal at VAH/VAL | | 2 | Initiative | 5 criteria: delta โ‰ฅ threshold, volume โ‰ฅ 1.5x average, body โ‰ฅ 3 ticks, delta/price aligned, one-sided imbalance bonus | Delta, Footprint, Volume | Break-even / trail trigger | | 3 | Sweep | Price through โ‰ฅ3 thin orderbook levels + low volume per level + thin book confirmation (โ‰ฅ2 thin levels on swept side) | Orderbook, Price | Liquidity grab / reversal alert | | 4 | Exhaustion | Price trending + volume declining >30% + negative volume/delta trend + optional contrarian imbalance at extreme | Volume trend, Delta ROC, Footprint | Exit warning โ€” momentum fading | | 5 | Divergence | Price new high/low but cumulative delta peak/trough fails to confirm (<80% of prior) | Price, Cumulative Delta peaks | Trend reversal warning |

Strength Score Calculation

| Pattern | Score Formula | Range | |---------|--------------|-------| | Absorption | (volume / minaggressive) 40 or (vol / minaggressive) 30 + attempts * 15 | 0-75 | | Initiative | (delta/threshold)20 + volaccel15 + bodyticks5 + imbalance_count10 | 0-50+ | | Sweep | levels15 + efficiency20 + displacement1000 + thin_confirm15 | 30-100 | | Exhaustion | 40 + |voltrend|5 + |deltaroc|5 + contrarian_bonus(20) | 40-70 | | Divergence | 30 + (1 - ratio)40 + pricenewextreme10 | 30-80 |


Volume Profile Framing (Daily Bias)

Implements Fabio Testa's profile shape analysis to determine the daily directional bias and identify qualified levels to trade from.

Profile Shapes

P-SHAPE (Buyers in Control)        b-SHAPE (Sellers in Control)
Volume โ”‚                           Volume โ”‚
  โ–ˆ    โ”‚                                  โ”‚ โ–ˆ
  โ–ˆโ–ˆ   โ”‚                                  โ”‚ โ–ˆโ–ˆ
  โ–ˆโ–ˆโ–ˆ  โ”‚     POC > 65%                    โ”‚ โ–ˆโ–ˆโ–ˆ     POC < 35%
  โ–ˆโ–ˆโ–ˆโ–ˆ โ”‚     Bias: LONG                   โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆ    Bias: SHORT
  โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ”‚                                  โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Price            โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Price
  VAL  โ”‚  POC  VAH                         VAH  POC  VAL

D-SHAPE (Balanced) DOUBLE DISTRIBUTION Volume โ”‚ Volume โ”‚ โ–ˆ โ”‚ โ–ˆ โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆ โ”‚ โ–ˆโ–ˆ โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆ โ”‚ โ–ˆโ–ˆโ–ˆ POC ~50% โ”‚ โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘โ–‘ (valley) โ–ˆโ–ˆโ–ˆโ–ˆ โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆ Bias: NEUTRAL โ”‚ โ–ˆโ–ˆโ–ˆโ–ˆ โ–ˆโ–ˆโ–ˆโ–ˆ Bias: TRANSITION โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Price โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Price VAL โ”‚ POC โ”‚ VAH VAHโ‚ VALโ‚ VAHโ‚‚ VALโ‚‚

| Shape | POC Position | Bias | Confidence Base | Trading Plan | |-------|-------------|------|----------------|-------------| | P-shape | >65% from bottom | LONG | 40 + poc_pctร—30 | Buyers in control, buy dips to VAL | | b-shape | <35% from bottom | SHORT | 40 + (1-poc_pct)ร—30 | Sellers in control, sell rallies to VAH | | D-shape | ~50% | NEUTRAL | 20 | Balanced, fade extremes | | Double Distribution | Bimodal (valley <50% of peaks) | NEUTRAL | 30 | Transition โ€” watch for breakout |

Qualified Levels

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  QUALIFIED LEVELS (Trade From These)             โ”‚
โ”‚                                                                  โ”‚
โ”‚  Price โ–ฒ                                                         โ”‚
โ”‚       โ”‚     โ”Œโ”€โ”€โ”€ VAH (Value Area High) โ”€โ”€โ”€ SELL ZONE            โ”‚
โ”‚       โ”‚     โ”‚                                                    โ”‚
โ”‚       โ”‚     โ”‚    โ”Œโ”€โ”€ MERGED VAH โ”€โ”€โ”€ Strong SELL (str=70)        โ”‚
โ”‚       โ”‚     โ”‚    โ”‚  (confluent across multiple days)             โ”‚
โ”‚       โ”‚     โ”‚                                                    โ”‚
โ”‚       โ”‚     โ”‚  โ”Œโ”€โ”€ LVN (Low Volume Node) โ”€โ”€โ”€ Rebalancing        โ”‚
โ”‚       โ”‚     โ”‚  โ”‚  (price magnet โ€” gaps fill fast)                โ”‚
โ”‚       โ”‚     โ”‚  โ”‚                                                โ”‚
โ”‚       โ”‚  โ”Œโ”€โ”€โ”ค  โ”‚  โ”Œโ”€โ”€ POC (Point of Control) โ”€โ”€โ”€ Pivot          โ”‚
โ”‚       โ”‚  โ”‚  โ”‚  โ”‚  โ”‚  (highest volume = fair value)               โ”‚
โ”‚       โ”‚  โ”‚  โ”‚  โ”‚  โ”‚                                            โ”‚
โ”‚       โ”‚  โ”‚  โ”œโ”€โ”€โ”ค  โ”‚  โ”Œโ”€โ”€ MERGED VAL โ”€โ”€โ”€ Strong BUY (str=70)    โ”‚
โ”‚       โ”‚  โ”‚  โ”‚  โ”‚  โ”‚  โ”‚  (confluent across multiple days)        โ”‚
โ”‚       โ”‚  โ”‚  โ”‚  โ”‚  โ”‚  โ”‚                                        โ”‚
โ”‚       โ”‚  โ””โ”€โ”€โ”ค  โ”‚  โ”‚  โ”‚  โ””โ”€โ”€ VAL (Value Area Low) โ”€โ”€โ”€ BUY ZONE  โ”‚
โ”‚       โ”‚     โ”‚  โ”‚  โ”‚                                           โ”‚
โ”‚       โ””โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€         โ”‚
โ”‚                โ”‚                                                 โ”‚
โ”‚  Confluence Bonus: +20 strength when level matches across days  โ”‚
โ”‚  Multi-day merge: overlapping profiles (>30% VA overlap) merged โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Multi-Day Context Checks

| Check | What It Does | Effect | |-------|-------------|--------| | Value accepted higher | Current VA above prior VA | +15 confidence if aligned with bias | | VAH rejection | Price rejected at VAH across multiple days | Bias โ†’ WARNING, -10 penalty to composite score | | Failed auction ("hooks") | Bullish hook below VAL, bearish hook above VAH | Reduces confidence |


State Machine Trade Lifecycle

Every instrument runs an independent state machine. The system watches qualified levels, detects absorption entries, manages the trade through break-even and trailing stops, and auto-closes on strong exit signals.

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                    STATE MACHINE TRADE LIFECYCLE                        โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘                                                                          โ•‘
โ•‘   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ•‘
โ•‘   โ”‚  NO ACTIVE TRADE                                            โ”‚        โ•‘
โ•‘   โ”‚  Price approaches qualified level (strength >= 50)          โ”‚        โ•‘
โ•‘   โ”‚  Aggregator auto-watches level                              โ”‚        โ•‘
โ•‘   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ•‘
โ•‘                            โ”‚                                             โ•‘
โ•‘                            โ–ผ                                             โ•‘
โ•‘   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ•‘
โ•‘   โ”‚  WATCHING                                                   โ”‚        โ•‘
โ•‘   โ”‚  Monitoring level for absorption or sweep signals           โ”‚        โ•‘
โ•‘   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ•‘
โ•‘           โ”‚ ABSORPTION detected            โ”‚ SWEEP detected              โ•‘
โ•‘           โ”‚ (composite >= 40)              โ”‚ (thin book displacement)    โ•‘
โ•‘           โ–ผ                                 โ–ผ                            โ•‘
โ•‘   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ•‘
โ•‘   โ”‚ ABSORPTION   โ”‚               โ”‚ ALERT ONLY           โ”‚               โ•‘
โ•‘   โ”‚ DETECTED     โ”‚               โ”‚ (sweep notification, โ”‚               โ•‘
โ•‘   โ”‚ (transient)  โ”‚               โ”‚  no entry)           โ”‚               โ•‘
โ•‘   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ•‘
โ•‘          โ”‚ Entry signal sent, SL/TP calculated                            โ•‘
โ•‘          โ–ผ                                                                โ•‘
โ•‘   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ•‘
โ•‘   โ”‚  POSITION_OPEN                                              โ”‚        โ•‘
โ•‘   โ”‚  Trade entered. Waiting for initiative (BE trigger)         โ”‚        โ•‘
โ•‘   โ”‚  OR watching for exit warnings (exhaustion/divergence)      โ”‚        โ•‘
โ•‘   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ•‘
โ•‘           โ”‚ INITIATIVE (same dir)          โ”‚ EXIT WARNING (opposite dir) โ•‘
โ•‘           โ”‚ Move SL to entry price         โ”‚ str >= 70 โ†’ auto-close      โ•‘
โ•‘           โ–ผ                                 โ–ผ                            โ•‘
โ•‘   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ•‘
โ•‘   โ”‚ BREAK_EVEN   โ”‚               โ”‚ CLOSED               โ”‚               โ•‘
โ•‘   โ”‚ SL = entry   โ”‚               โ”‚ (auto-close on strong โ”‚               โ•‘
โ•‘   โ”‚ Risk-free    โ”‚               โ”‚  exit signal)         โ”‚               โ•‘
โ•‘   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ•‘
โ•‘          โ”‚ INITIATIVE (same dir)                                             โ•‘
โ•‘          โ”‚ Trail SL to candle extreme                                        โ•‘
โ•‘          โ–ผ                                                                  โ•‘
โ•‘   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”         โ•‘
โ•‘   โ”‚  TRAILING                                                   โ”‚         โ•‘
โ•‘   โ”‚  SL trails to candle low (longs) or high (shorts)           โ”‚         โ•‘
โ•‘   โ”‚  Each new initiative print moves the trail                  โ”‚         โ•‘
โ•‘   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜         โ•‘
โ•‘           โ”‚ More INITIATIVE               โ”‚ EXIT WARNING (str>=70)        โ•‘
โ•‘           โ”‚ Keep trailing                 โ”‚ or SL hit                     โ•‘
โ•‘           โ–ผ                                 โ–ผ                              โ•‘
โ•‘   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”               โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                โ•‘
โ•‘   โ”‚ (loop back)  โ”‚               โ”‚ CLOSED               โ”‚                โ•‘
โ•‘   โ”‚ TRAILING     โ”‚โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ–ถโ”‚ Trade logged to      โ”‚                โ•‘
โ•‘   โ”‚              โ”‚               โ”‚ journal + Telegram   โ”‚                โ•‘
โ•‘   โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                โ•‘
โ•‘                                                                            โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Supported Instruments (29)

Each instrument has pre-tuned thresholds for all 5 pattern detectors, optimized for its volatility and tick size.

Index Futures (9)

| Instrument | Tick Size | Absorption Min Vol | Initiative Min Delta | VP Tick Size | Session | |-----------|-----------|-------------------|---------------------|-------------|---------| | NAS100 | 0.1 | 50 | 30 | 1.0 | NY Cash | | SP500 | 0.1 | 40 | 25 | 1.0 | NY Cash | | DJ30 | 1.0 | 40 | 25 | 5.0 | NY Cash | | UK100 | 0.1 | 30 | 20 | 1.0 | London | | DAX40 | 0.1 | 30 | 20 | 2.0 | London | | NIKKEI225 | 1.0 | 30 | 20 | 50.0 | Asian | | CAC40 | 0.1 | 25 | 18 | 1.0 | London | | ASX200 | 0.1 | 25 | 18 | 1.0 | Asian | | HK50 | 1.0 | 25 | 18 | 5.0 | Asian |

Metals, Energy, Crypto

| Instrument | Category | Tick Size | VP Tick Size | Session | |-----------|----------|-----------|-------------|---------| | XAUUSDT (Gold) | Metal | 0.01 | 0.50 | NY Cash | | XAGUSD (Silver) | Metal | 0.001 | 0.05 | Full Day | | USOIL | Energy | 0.01 | 0.10 | NY Cash | | UKOIL | Energy | 0.01 | 0.10 | London | | BTCUSDT | Crypto | 0.01 | 10.0 | Full Day |

Forex (10 Pairs)

| Instrument | Tick Size | VP Tick Size | Session | |-----------|-----------|-------------|---------| | EURUSD | 0.00001 | 0.0005 | Full Day | | GBPUSD | 0.00001 | 0.0005 | Full Day | | USDJPY | 0.001 | 0.05 | Full Day | | AUDUSD | 0.00001 | 0.0005 | Full Day | | USDCAD | 0.00001 | 0.0005 | Full Day | | USDCHF | 0.00001 | 0.0005 | Full Day | | NZDUSD | 0.00001 | 0.0005 | Full Day | | EURGBP | 0.00001 | 0.0005 | Full Day | | EURJPY | 0.001 | 0.05 | Full Day | | GBPJPY | 0.001 | 0.05 | Full Day |

US Stocks (7)

| Instrument | Tick Size | VP Tick Size | Session | |-----------|-----------|-------------|---------| | AAPL | 0.01 | 0.50 | NY Cash | | TSLA | 0.01 | 0.50 | NY Cash | | AMZN | 0.01 | 0.50 | NY Cash | | MSFT | 0.01 | 0.50 | NY Cash | | NVDA | 0.01 | 0.50 | NY Cash | | META | 0.01 | 0.50 | NY Cash | | GOOGL | 0.01 | 0.50 | NY Cash |


Data Sources

Dual Feed Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     DATA SOURCE OPTIONS                     โ”‚
โ”‚                                                             โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚      MT5 FEED        โ”‚    โ”‚      BYBIT FEED         โ”‚   โ”‚
โ”‚  โ”‚                      โ”‚    โ”‚                         โ”‚   โ”‚
โ”‚  โ”‚  Source: MT5 terminalโ”‚    โ”‚  Source: Bybit WebSocketโ”‚   โ”‚
โ”‚  โ”‚  Requires: Account   โ”‚    โ”‚  Requires: Nothing      โ”‚   โ”‚
โ”‚  โ”‚  Ticks: 100ms pollingโ”‚    โ”‚  Ticks: Real-time streamโ”‚   โ”‚
โ”‚  โ”‚  Orderbook: DOM data โ”‚    โ”‚  Orderbook: 50 levels   โ”‚   โ”‚
โ”‚  โ”‚  History: Up to 3 daysโ”‚   โ”‚  History: None          โ”‚   โ”‚
โ”‚  โ”‚  Aggressor: Buy/Sell โ”‚    โ”‚  Aggressor: Trade side  โ”‚   โ”‚
โ”‚  โ”‚  flag from MT5       โ”‚    โ”‚  from Bybit API         โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚             โ”‚                             โ”‚                  โ”‚
โ”‚             โ”‚  DATA_SOURCE = "MT5"        โ”‚  "BYBIT"         โ”‚
โ”‚             โ”‚  DATA_SOURCE = "BOTH" โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                  โ”‚
โ”‚             โ”‚                                                โ”‚
โ”‚             โ–ผ                                                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                    โ”‚
โ”‚  โ”‚  Symbol Auto-Discovery (MT5)        โ”‚                    โ”‚
โ”‚  โ”‚  200+ broker-specific name variants โ”‚                    โ”‚
โ”‚  โ”‚  e.g. USTEC, USTECm, NAS100, US100 โ”‚                    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

MT5 Symbol Mapping

The system auto-discovers instruments across 200+ broker-specific naming variants:

| Internal | MT5 Symbol | Alternatives | |----------|-----------|-------------| | NAS100 | USTECm | USTEC, NAS100, US100, NQ100, NAS100USD... | | XAUUSDT | XAUUSDm | XAUUSD, GOLD... | | EURUSD | EURUSDm | EURUSD, EUR/USD... | | BTCUSDT | BTCUSDm | BTCUSD, BTC/USD... |


Dashboard

Frontend Components (8 custom JS modules)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                     ORDERFLOW DASHBOARD                              โ”‚
โ”‚                                                                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚        PRICE CHART (app.js)       โ”‚  โ”‚   VOLUME PROFILE       โ”‚  โ”‚
โ”‚  โ”‚   TradingView lightweight-charts  โ”‚  โ”‚   Horizontal bars      โ”‚  โ”‚
โ”‚  โ”‚   Signal markers overlay:         โ”‚  โ”‚   POC, VAH, VAL marks  โ”‚  โ”‚
โ”‚  โ”‚   โ–ฒ Absorption (teal)            โ”‚  โ”‚   Shape classification  โ”‚  โ”‚
โ”‚  โ”‚   โ–ฒ Initiative (green)           โ”‚  โ”‚   LVN markers          โ”‚  โ”‚
โ”‚  โ”‚   โ–ฒ Sweep (purple)               โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚  โ”‚   โ— Exhaustion (yellow)                                        โ”‚
โ”‚  โ”‚   โ— Divergence (orange)          โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚   โ— Entry/Exit markers           โ”‚   FOOTPRINT CHART      โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚   Bid/Ask per level   โ”‚    โ”‚
โ”‚                                       โ”‚   Imbalance highlights โ”‚    โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚  โ”‚        SIGNAL CARDS (signals.js)  โ”‚                             โ”‚
โ”‚  โ”‚   Real-time trade recommendations โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚
โ”‚  โ”‚   Entry/SL/TP/RR display          โ”‚  โ”‚  ORDERBOOK DEPTH       โ”‚โ”‚
โ”‚  โ”‚   Pattern breakdown               โ”‚  โ”‚  Bid/Ask ladder        โ”‚โ”‚
โ”‚  โ”‚   Grade (A+/A/B/C)                โ”‚  โ”‚  Thin level markers    โ”‚โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚  Spread indicator      โ”‚โ”‚
โ”‚                                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”โ”‚
โ”‚  โ”‚  PERFORMANCE (performance.js)     โ”‚  โ”‚  TIME & SALES (tape.js)โ”‚โ”‚
โ”‚  โ”‚  Win rate, PnL, RR distribution   โ”‚  โ”‚  Tick-by-tick feed     โ”‚โ”‚
โ”‚  โ”‚  Trade history                    โ”‚  โ”‚  Big trade highlights  โ”‚โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜โ”‚
โ”‚                                                                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚              MICROSTRUCTURE (microstructure.js)               โ”‚  โ”‚
โ”‚  โ”‚  Market state ยท Session ยท Absorption ยท Delta ยท Exhaustion     โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

WebSocket Channels (9)

| Channel | Data | Throttle | Priority | |---------|------|----------|----------| | tick | Price, size, side | 200ms | High | | candle | OHLCV + delta | None (immediate) | Critical | | signal | AggregatedSignal | None (immediate) | Critical | | trade_state | TradePhase transitions | None (immediate) | Critical | | volume_profile | POC/VAH/VAL/shape | None | Normal | | bias | DailyBias updates | None | Normal | | orderbook | L2 depth + imbalance | 500ms | Normal | | delta | Cumulative delta history | 200ms | Normal | | stats | System-wide per-instrument | 5000ms | Low |


Telegram Alerts

Automated notifications for every trade lifecycle event:

| Alert Type | Trigger | Content | |-----------|---------|---------| | ENTRY SIGNAL | Absorption at qualified level, composite โ‰ฅ40 | Direction, score, pattern, delta, volume, bias, entry/SL/TP/RR | | BREAK EVEN | First initiative auction after entry | SL moved to entry price โ€” risk-free trade | | TRAIL UPDATE | Subsequent initiative prints | New SL level, trail progress | | EXIT SIGNAL | Trade closed (SL hit or auto-close) | PnL ticks, RR achieved, trade summary | | EXIT WARNING | Exhaustion or divergence detected | Pattern details, strength, direction warning | | DAILY BIAS | New VP shape computed | Shape, direction, confidence, POC/VAH/VAL, qualified levels |


Database

SQLite Schema (5 Tables)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                    orderflow_data.db (WAL mode)                  โ”‚
โ”‚                                                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”‚
โ”‚  โ”‚  ticks    โ”‚ โ”‚ candles  โ”‚ โ”‚ volume_profilesโ”‚ โ”‚ signals  โ”‚    โ”‚
โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค    โ”‚
โ”‚  โ”‚ id (PK)  โ”‚ โ”‚ id (PK)  โ”‚ โ”‚ id (PK)        โ”‚ โ”‚ id (PK)  โ”‚    โ”‚
โ”‚  โ”‚instrumentโ”‚ โ”‚instrumentโ”‚ โ”‚ instrument     โ”‚ โ”‚instrumentโ”‚    โ”‚
โ”‚  โ”‚timestamp โ”‚ โ”‚timestamp โ”‚ โ”‚ session_date   โ”‚ โ”‚timestamp โ”‚    โ”‚
โ”‚  โ”‚ price    โ”‚ โ”‚timeframe โ”‚ โ”‚ poc, vah, val  โ”‚ โ”‚sig_type  โ”‚    โ”‚
โ”‚  โ”‚ size     โ”‚ โ”‚ OHLCV    โ”‚ โ”‚ total_volume   โ”‚ โ”‚direction โ”‚    โ”‚
โ”‚  โ”‚ side     โ”‚ โ”‚ buy/sell โ”‚ โ”‚ shape          โ”‚ โ”‚price_lvl โ”‚    โ”‚
โ”‚  โ”‚ tradeid โ”‚ โ”‚ delta    โ”‚ โ”‚ pocpos_pct    โ”‚ โ”‚ strength โ”‚    โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚footprint โ”‚ โ”‚ lvn (JSON)     โ”‚ โ”‚details   โ”‚    โ”‚
โ”‚               โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ volatprice   โ”‚ โ”‚  (JSON)  โ”‚    โ”‚
โ”‚                             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜    โ”‚
โ”‚                                                                  โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                                               โ”‚
โ”‚  โ”‚ trade_journalโ”‚                                               โ”‚
โ”‚  โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค                                               โ”‚
โ”‚  โ”‚ id (PK)      โ”‚                                               โ”‚
โ”‚  โ”‚ instrument   โ”‚                                               โ”‚
โ”‚  โ”‚ direction    โ”‚                                               โ”‚
โ”‚  โ”‚ entry/exit   โ”‚                                               โ”‚
โ”‚  โ”‚  time (ms)   โ”‚                                               โ”‚
โ”‚  โ”‚ entry/exit   โ”‚                                               โ”‚
โ”‚  โ”‚  price       โ”‚                                               โ”‚
โ”‚  โ”‚ SL, TP       โ”‚                                               โ”‚
โ”‚  โ”‚ pnl_ticks    โ”‚                                               โ”‚
โ”‚  โ”‚ rr_ratio     โ”‚                                               โ”‚
โ”‚  โ”‚ signals(JSON)โ”‚                                               โ”‚
โ”‚  โ”‚ notes        โ”‚                                               โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                                               โ”‚
โ”‚                                                                  โ”‚
โ”‚  Indexes: (instrument, timestamp), (instrument, session_date)   โ”‚
โ”‚  PRAGMA: journal_mode=WAL, synchronous=NORMAL                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Installation

Prerequisites

  • Python 3.10+
  • MetaTrader 5 terminal (for MT5 feed) OR Bybit (free, no account needed)

Setup

# Clone the repository
git clone https://github.com/mahmoud20138/OrderFlow-Analysis-Pro.git
cd OrderFlow-Analysis-Pro

Install dependencies

pip install -e .

Or install manually

pip install websockets aiohttp pandas numpy scipy \ python-telegram-bot plotly kaleido aiosqlite pytz pyyaml

Quick Start (Bybit โ€” No Account Needed)

# 1. Set data source to BYBIT in config

2. Run the system

python -m orderflow_system.main

3. Open dashboard

http://localhost:8080

Quick Start (MT5)

# 1. Open MetaTrader 5 terminal

2. Configure credentials in config/settings.py

3. Run the system

python -m orderflow_system.main

Dashboard Only (Demo Mode)

# Run dashboard with deterministic demo data
python -m orderflow_system.dashboard

Configuration

All configuration is in orderflow_system/config/settings.py:

# Data source: "MT5", "BYBIT", or "BOTH"
DATA_SOURCE = DataSource.BYBIT

MT5 credentials (only if using MT5 feed)

MT5 = MT5Config( login=12345678, password="your_password", server="YourBroker-Server", pollintervalms=100, # Tick polling frequency enable_book=True, # Enable market book (DOM) downloadhistorydays=3, # Download M1 history for warmup )

Telegram alerts

TELEGRAM = TelegramConfig( bottoken="yourbot_token", chatid="yourchat_id", sendchartsnapshots=True, )

Dashboard

DASHBOARD = DashboardConfig( enabled=True, host="0.0.0.0", port=8080, log_level="warning", )

Database

DBPATH = "orderflowdata.db" LOG_LEVEL = "INFO"

Per-Instrument Threshold Tuning

Each instrument has its own config with tuned thresholds. Example for NAS100:

AbsorptionConfig(
    minaggressivevolume=50,      # Min volume to qualify as absorption
    maxpricedisplacement_ticks=2, # Max ticks price can move
    rollingwindowseconds=30,      # Lookback window
    min_attempts=2,                 # Min repeated attempts at level
    bigtradefilter=10,            # Volume threshold for "big" trade
)

InitiativeConfig( mindeltathreshold=30, # Min delta to qualify volumeaccelerationmin=1.5, # Must be 1.5x average volume minpricedisplacement_ticks=3, # Min body size deltapricealignment=True, # Delta must align with candle direction )


Usage

Start the System

python -m orderflow_system.main

The system will:

  • Connect to configured data source(s)
  • Download historical bars (MT5) or connect to live feed (Bybit)
  • Build initial volume profiles from historical data
  • Start 5 pattern detectors for all 29 instruments
  • Compute daily bias and qualified levels
  • Auto-watch strong levels (strength โ‰ฅ 50)
  • Begin state machine monitoring
  • Send Telegram alerts on signals
  • Serve dashboard at http://localhost:8080

Dashboard Endpoints

# View all instruments
curl http://localhost:8080/api/instruments

Get scanner ranking (all pairs by trade proximity)

curl http://localhost:8080/api/scanner

Get strategy status for NAS100

curl http://localhost:8080/api/strategy-status/NAS100USDT

Get volume profile

curl http://localhost:8080/api/volume-profile/NAS100USDT?days=5

Get daily bias

curl http://localhost:8080/api/bias/NAS100USDT

Get signal history

curl http://localhost:8080/api/signals/NAS100USDT?limit=50

Get active trade state

curl http://localhost:8080/api/trade/NAS100USDT

Project Structure

orderflow_system/
โ”œโ”€โ”€ main.py                          # System orchestrator (666L)
โ”œโ”€โ”€ init.py                      # Package init
โ”œโ”€โ”€ test_integration.py              # Integration tests (314L)
โ”‚
โ”œโ”€โ”€ config/
โ”‚   โ””โ”€โ”€ settings.py                  # 29 instrument configs, 10 config dataclasses (946L)
โ”‚
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ models.py                    # 7 dataclasses: Tick, Candle, Signal, TradeState... (290L)
โ”‚   โ”œโ”€โ”€ candle_builder.py            # Tick โ†’ 1m candle aggregation (133L)
โ”‚   โ”œโ”€โ”€ bybit_feed.py                # Bybit WebSocket feed (209L)
โ”‚   โ”œโ”€โ”€ mt5_feed.py                  # MT5 terminal feed with auto-discovery (495L)
โ”‚   โ””โ”€โ”€ database.py                  # SQLite persistence, 5 tables (278L)
โ”‚
โ”œโ”€โ”€ analytics/
โ”‚   โ”œโ”€โ”€ volume_profile.py            # POC, VAH, VAL, LVN, shape classification (258L)
โ”‚   โ”œโ”€โ”€ delta.py                     # Vertical, horizontal, cumulative delta (197L)
โ”‚   โ”œโ”€โ”€ footprint.py                 # Bid/ask per level, imbalance detection (181L)
โ”‚   โ””โ”€โ”€ orderbook.py                 # L2 depth, thin levels, consumption tracking (208L)
โ”‚
โ”œโ”€โ”€ patterns/
โ”‚   โ”œโ”€โ”€ absorption.py                # Effort >> result detection (257L)
โ”‚   โ”œโ”€โ”€ initiative.py                # Effort = result (momentum) (133L)
โ”‚   โ”œโ”€โ”€ sweep.py                     # Thin book displacement (142L)
โ”‚   โ”œโ”€โ”€ exhaustion.py                # Declining volume at extremes (228L)
โ”‚   โ””โ”€โ”€ divergence.py                # Price vs delta disagreement (159L)
โ”‚
โ”œโ”€โ”€ signals/
โ”‚   โ”œโ”€โ”€ profile_framing.py           # Daily bias + qualified levels (343L)
โ”‚   โ””โ”€โ”€ aggregator.py                # State machine + composite scoring (516L)
โ”‚
โ”œโ”€โ”€ alerts/
โ”‚   โ””โ”€โ”€ telegram_bot.py              # Telegram notifications (202L)
โ”‚
โ””โ”€โ”€ dashboard/
    โ”œโ”€โ”€ app.py                       # FastAPI REST + WebSocket (1015L)
    โ”œโ”€โ”€ websocket_manager.py         # 9-channel broadcast manager (186L)
    โ”œโ”€โ”€ demo_data.py                 # Deterministic demo data generator (782L)
    โ”œโ”€โ”€ main.py                  # Standalone launcher (35L)
    โ””โ”€โ”€ static/
        โ”œโ”€โ”€ index.html               # Main HTML shell (121L)
        โ”œโ”€โ”€ app.js                   # TradingView charts + WebSocket (939L)
        โ”œโ”€โ”€ style.css                # Dashboard styling (566L)
        โ”œโ”€โ”€ footprint.js             # Canvas footprint chart (700L)
        โ”œโ”€โ”€ signals.js               # Signal recommendation cards (479L)
        โ”œโ”€โ”€ performance.js           # Performance analytics (599L)
        โ”œโ”€โ”€ orderbook.js             # Orderbook depth ladder (318L)
        โ”œโ”€โ”€ microstructure.js        # Microstructure indicators (417L)
        โ””โ”€โ”€ tape.js                  # Time & sales (281L)

File Inventory

| Category | Files | Python Lines | JS/CSS/HTML Lines | Total Lines | |----------|-------|-------------|-------------------|-------------| | Config | 1 | 946 | โ€” | 946 | | Data | 5 | 1,405 | โ€” | 1,405 | | Analytics | 4 | 844 | โ€” | 844 | | Patterns | 5 | 919 | โ€” | 919 | | Signals | 2 | 859 | โ€” | 859 | | Alerts | 1 | 202 | โ€” | 202 | | Dashboard | 4 + 8 static | 1,818 | 4,420 | 6,238 | | Main + Tests | 2 | 980 | โ€” | 980 | | Total | ~32 | ~7,973 | ~4,420 | ~12,393 |


API Reference

REST Endpoints (16)

| Method | Endpoint | Description | |--------|----------|-------------| | GET | / | Dashboard UI | | GET | /api/instruments | Active instruments with stats + trade phase | | GET | /api/scanner | All pairs ranked by trade proximity (priority 0-118) | | GET | /api/markers/{symbol} | TradingView chart markers for signal events | | GET | /api/candles/{symbol} | OHLCV candle history (params: count, tf, range) | | GET | /api/volume-profile/{symbol} | Volume profile with POC/VAH/VAL (params: days, range) | | GET | /api/bias/{symbol} | Daily bias + qualified levels | | GET | /api/signals/{symbol} | Signal history (params: limit) | | GET | /api/trade/{symbol} | Active trade state | | GET | /api/strategy-status/{symbol} | 6-step Fabio methodology checklist | | GET | /api/orderbook/{symbol} | Current L2 orderbook (params: levels) | | GET | /api/delta/{symbol} | Cumulative delta history (params: count, tf, range) | | GET | /api/footprint/{symbol} | Footprint chart data (params: tf, range) | | GET | /api/tape/{symbol} | Time & sales (params: count) | | GET | /api/microstructure/{symbol} | Microstructure snapshot | | GET | /api/stats | System-wide stats |

Strategy Status Labels

| Status | Meaning | |--------|---------| | NO_DATA | No data received yet | | NO_LEVELS | No qualified levels identified | | WAITINGFORPRICE | Levels exist, price not nearby | | ATLEVELSCANNING | Price near a qualified level | | WATCHING | Aggregator actively watching a level | | ENTRY_READY | Absorption detected, composite score โ‰ฅ threshold | | IN_TRADE | Position open | | BREAK_EVEN | SL moved to entry | | TRAILING | SL trailing on initiative | | IDLE | No active monitoring |

Scanner Priority Scoring

| State | Base Score | Bonus | |-------|-----------|-------| | IN_TRADE | 100 | +3 per completed step | | TRAILING | 95 | +3 per completed step | | BREAK_EVEN | 90 | +3 per completed step | | ENTRY_READY | 85 | +3 per completed step | | ATLEVELSCANNING | 70 | +3 per completed step | | WATCHING | 60 | +3 per completed step | | WAITINGFORPRICE | 40 | โ€” | | NO_LEVELS | 20 | โ€” | | NO_DATA | 10 | โ€” | | OFFLINE | 5 | โ€” | | IDLE | 0 | โ€” |


Demo Mode

The system includes a deterministic demo data generator that produces realistic data for all 29 instruments โ€” no data feed required. Runs via:

python -m orderflow_system.dashboard

Generates:

  • OHLCV candles via random walk (seeded per symbol/timeframe)
  • Volume profiles with Gaussian distributions
  • Cumulative delta with bar-level noise
  • Orderbooks with ~15% thin levels
  • 6 institutional-grade signal templates with narrative, thesis, edge, invalidation, HTF context, session, regime, MTF confluence, blockers, and grade

Signal Quality Grading

| Grade | Score | Meaning | |-------|-------|---------| | A+ | โ‰ฅ85 | Exceptional โ€” multiple confirmations, high confluence | | A | โ‰ฅ70 | Strong โ€” solid pattern + level + bias alignment | | B | โ‰ฅ55 | Good โ€” pattern detected, partial confluence | | C | <55 | Weak โ€” pattern only, consider skipping |


Signal Output Examples

Entry Signal

ENTRY SIGNAL: NAS100 LONG
  Composite Score: 72/100
  Pattern: ABSORPTION at VAL (17,845.50)
  Delta: +1,250 (buyers absorbing sells)
  Volume: 3.2x average
  Bias: P-shape (LONG), confidence 85%
  Entry: 17,846.00 | SL: 17,830.00 | TP: 17,878.00
  R:R: 1:2.0
  Grade: A

Daily Bias Update

DAILY BIAS: NAS100
  Shape: P-shape (buyers in control)
  Direction: LONG | Confidence: 85%
  POC: 17,852.00 | VAH: 17,890.00 | VAL: 17,820.00
  LVN: [17,835.00, 17,868.00]
  Qualified Levels: VAL (buy, str=50), MERGED_VAL (buy, str=70)

Strategy Status

STRATEGY STATUS: NAS100
  Step 1: Profile Framing    โœ“ P-shape, LONG, 85%
  Step 2: Qualified Levels   โœ“ VAL=17820, MERGED_VAL=17815
  Step 3: Price at Level     โœ“ Price 17825 near VAL
  Step 4: Absorption Scan    โœ“ Detected, strength 72
  Step 5: Entry Decision     โœ“ Composite 72 โ‰ฅ 40
  Step 6: Trade Management   โณ Waiting for initiative
  Overall: ENTRY_READY

How Pattern Detection Works

Absorption Detection (2 Methods)

Method 1: Delta/Close Mismatch
โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”
  Delta: +500 (buying)     Delta: -400 (selling)
  Candle: RED (closed โ†“)   Candle: GREEN (closed โ†‘)
  โ†’ SELLERS absorbing      โ†’ BUYERS absorbing
  โ†’ Signal: SELL            โ†’ Signal: BUY

Strength = (|delta| / minaggressivevolume) * 40

Method 2: Level Absorption โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ”โ” Track aggressive volume at each price level over rolling window. If volume >= minaggressive AND attempts >= minattempts: โ†’ ABSORPTION signal Strength = (vol / min_aggressive) 30 + attempts 15

Initiative Detection (5 Criteria)

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  INITIATIVE = Aggressive Conviction                      โ”‚
โ”‚                                                          โ”‚
โ”‚  All 5 must be met:                                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”        โ”‚
โ”‚  โ”‚ 1. |delta| >= mindeltathreshold (30)       โ”‚  โœ“/โœ—  โ”‚
โ”‚  โ”‚ 2. volume / avg >= volume_accel (1.5x)       โ”‚  โœ“/โœ—  โ”‚
โ”‚  โ”‚ 3. bodysize >= mindisplacement (3 ticks)   โ”‚  โœ“/โœ—  โ”‚
โ”‚  โ”‚ 4. delta direction == candle direction       โ”‚  โœ“/โœ—  โ”‚
โ”‚  โ”‚ 5. Bonus: one-sided imbalance prints (>3.0)  โ”‚  +10  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜        โ”‚
โ”‚                                                          โ”‚
โ”‚  Strength = delta20 + accel15 + body5 + imbalance10 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Composite Scoring System

The SignalAggregator computes a composite score (0-100) that determines whether a signal becomes a trade:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              COMPOSITE SCORE CALCULATION                  โ”‚
โ”‚                                                          โ”‚
โ”‚  Signal Weight (varies by pattern):                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”                             โ”‚
โ”‚  โ”‚ Absorption     โ”‚  ร—0.30 โ”‚  โ† Highest weight          โ”‚
โ”‚  โ”‚ Divergence     โ”‚  ร—0.25 โ”‚                             โ”‚
โ”‚  โ”‚ Initiative     โ”‚  ร—0.20 โ”‚                             โ”‚
โ”‚  โ”‚ Sweep          โ”‚  ร—0.20 โ”‚                             โ”‚
โ”‚  โ”‚ Other          โ”‚  ร—0.15 โ”‚                             โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜                             โ”‚
โ”‚                                                          โ”‚
โ”‚  Level Strength:     ร—0.25                               โ”‚
โ”‚  Bias Alignment:     ร—0.20 (if direction matches)        โ”‚
โ”‚  Bias WARNING:       -10   (penalty if VA rejected)      โ”‚
โ”‚                                                          โ”‚
โ”‚  Final: clamped to [0, 100]                              โ”‚
โ”‚  Minimum to enter:   40 (configurable)                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

SL/TP Calculation

| Scenario | SL (LONG) | TP (LONG) | SL (SHORT) | TP (SHORT) | |----------|-----------|-----------|------------|------------| | With bias | val - (vah-val)ร—0.1 | vah | vah + (vah-val)ร—0.1 | val | | No bias | price ร— 0.997 (-0.3%) | price ร— 1.006 (+0.6%) | price ร— 1.003 (+0.3%) | price ร— 0.994 (-0.6%) |


Contributing

See CONTRIBUTING.md for guidelines. PRs welcome โ€” bug fixes, new pattern detectors, additional instruments, dashboard improvements.

License

MIT โ€” use freely in personal and commercial projects.

Disclaimer

This software is for educational and research purposes only. It is not financial advice. Trading involves substantial risk of loss. Past performance is not indicative of future results. Use at your own risk.

๐Ÿ”— More in this category

ยฉ 2026 GitRepoTrend ยท mahmoud20138/OrderFlow-Analysis-Pro ยท Updated daily from GitHub