π§ The Market's Hidden Pulse Revealed
Order Flow Imbalance Analyzer (OFIA) is a sophisticated algorithmic toolkit that transforms raw market data into actionable intelligence by quantifying the subtle pressure differentials between buy and sell orders. Unlike traditional volume indicators that merely count transactions, OFIA dissects the market's microstructure to reveal the genuine directional bias hidden within each price movement. Think of it as a financial stethoscope that listens to the market's heartbeat, distinguishing between healthy circulation and concerning arrhythmias before they manifest on the standard price chart.
This repository provides a comprehensive, platform-agnostic implementation designed for quantitative analysts, systematic traders, and financial researchers seeking to understand the underlying mechanics of price discovery across various asset classes.
Current Stable Release: v2.1.0 (Quantum Edition)
Release Date: March 15, 2026
Compatibility: Windows 10+, macOS 12+, Linux (Ubuntu 20.04+)
Markets communicate through imbalance. Every price tick tells a story of aggression versus passivity, absorption versus distribution. OFIA operates on the principle that true directional conviction isn't found in the final price alone, but in the journey of orders flowing through the limit order book. By aggregating and analyzing these micro-imbalances, we construct a cumulative narrative of supply and demand that often precedes significant price movements.
- Tick-Level Analysis: Processes each individual trade to classify it as buyer-initiated or seller-initiated based on sophisticated algorithms that consider tick rules, quote alignment, and trade sequencing.
- Volume-Weighted Imbalance: Calculates not just the direction but the conviction behind each transaction, giving greater weight to larger orders that represent institutional activity.
- Time-Sliced Aggregation: Provides customizable time windows (from milliseconds to days) for imbalance analysis, allowing both high-frequency and swing-trading perspectives.
- Interactive Dashboard: A responsive web-based interface built with modern frameworks that displays cumulative delta, order flow profiles, and imbalance heatmaps in real-time.
- Custom Chart Overlays: Seamlessly integrates with popular trading platforms through custom DLLs and APIs, providing visual overlays that complement existing technical analysis.
- Historical Reconstruction: Replay market sessions with full order flow context to study how imbalances developed during significant price events.
- Machine Learning Bridge: Pre-processed imbalance data is formatted for direct ingestion into TensorFlow, PyTorch, and scikit-learn pipelines for predictive modeling.
- API-First Architecture: RESTful and WebSocket endpoints allow external systems to subscribe to real-time imbalance metrics or query historical analyses.
- Multi-Platform Support: Core logic is written in portable C++ with bindings for Python, C#, and Java, ensuring compatibility across research and production environments.
| Platform | π₯οΈ Minimum Specifications | β Status | π Notes |
|---|---|---|---|
| Windows | 64-bit, 8GB RAM, SSE4.2 | π’ Fully Supported | DirectX 11 recommended for GPU acceleration |
| macOS | Apple Silicon or Intel i5+, 8GB RAM | π’ Fully Supported | Native M-series optimization included |
| Linux | Ubuntu 20.04+, 4GB RAM | π’ Fully Supported | CLI interface excels on server deployments |
| Docker | Any host with Docker Engine 20+ | π‘ Containerized Version | Lightweight deployment option available |
graph TD
A[Market Data Feed] --> B{Tick Processor}
B --> C[Trade Classification Engine]
C --> D[Imbalance Calculator]
D --> E[Cumulative Delta Stream]
E --> F[Real-Time API]
E --> G[Historical Database]
F --> H[Web Dashboard]
F --> I[Platform Integration]
G --> J[Analytics Engine]
J --> K[Machine Learning Models]
J --> L[Custom Alerts]
H --> M[End User]
I --> N[Trading Platform]
K --> O[Predictive Signals]
pip install ofia-analyzer
python -m ofia --config sample_config.yaml# OFIA Configuration Profile - Professional Edition
version: "2.1"
data_sources:
primary_feed:
type: "polygon_websocket" # Alternatives: "iqfeed", "dukascopy", "csv_file"
api_key: "${POLYGON_KEY}"
symbols: ["ES", "NQ", "RTY"]
backup_feed:
type: "alpaca"
enabled: false
processing:
classification_method: "tick_rule_enhanced" # tick_rule, quote_rule, LR_algorithm
volume_weighting: "sqrt_scale" # linear, log, sqrt_scale
aggregation_periods: ["1s", "1m", "5m", "1h"]
filters:
exclude_outliers: true
min_trade_size: 10 # contracts/shares
business_hours_only: true
output:
realtime:
websocket_port: 8765
rest_api_port: 8080
broadcast_rate: 10 # updates per second
storage:
database: "influxdb" # postgresql, sqlite, none
retention_days: 90
compressed: true
integrations:
tradingview_webhook: false
discord_alerts: true
email_summary: "daily"
ui:
theme: "dark_pro"
default_layout: "market_maker"
language: "en" # en, es, fr, de, ja, zh# Basic startup with interactive mode
ofia --symbol ES --source polygon --output dashboard
# Backtest historical imbalance patterns
ofia analyze --start 2026-01-01 --end 2026-03-01 --symbols ES,NQ \
--metric cumulative_delta_divergence --report html
# Server mode for multi-user access
ofia server --host 0.0.0.0 --port 8080 --auth jwt \
--config /etc/ofia/production.yaml --log-level INFO
# Generate machine learning datasets
ofia export --format parquet --features imbalance_ratio,vwap_delta \
--target next_5min_return --split-by-yearimport ofia
from openai import OpenAI
# Generate natural language insights from imbalance patterns
client = OpenAI(api_key=your_key)
imbalance_data = ofia.get_session_imbalance("ES", "2026-03-15")
response = client.chat.completions.create(
model="gpt-4-turbo",
messages=[{
"role": "system",
"content": "You are a quantitative market analyst."
}, {
"role": "user",
"content": f"Analyze this order flow imbalance data: {imbalance_data}"
}]
)
print(response.choices[0].message.content)import anthropic
from ofia.strategies import ImbalanceStrategyFramework
claude = anthropic.Anthropic(api_key=your_key)
framework = ImbalanceStrategyFramework()
# Have Claude develop trading logic based on imbalance signals
strategy_prompt = f"""
Based on the following imbalance characteristics:
{framework.get_metrics_description()}
Develop a mean-reversion strategy that uses cumulative delta extremes
as contrarian signals with the following constraints:
- Maximum 2 trades per day
- Stop loss of 0.5%
- Only trade between 9:30 AM and 4:00 PM EST
- Require confirmation from volume profile
Provide the logic in Python pseudocode.
"""
response = claude.messages.create(
model="claude-3-opus-20240229",
max_tokens=1000,
messages=[{"role": "user", "content": strategy_prompt}]
)OFIA embraces global accessibility with:
- Full Interface Translation: English, Spanish, French, German, Japanese, and Chinese (Simplified)
- Screen Reader Optimization: All visual elements include descriptive text alternatives
- Keyboard Navigation: Complete functionality accessible without mouse interaction
- Colorblind-Friendly Palettes: Multiple theme options for different visual needs
- Timezone Agnostic: All timestamps stored in UTC with automatic local conversion
- 24/7 Monitoring: Automated health checks with SMS/email alerts for system anomalies
- Graceful Degradation: If primary data feeds fail, the system automatically switches to backups while preserving calculation integrity
- Audit Trail: Every calculation and configuration change is logged with cryptographic hashing for compliance requirements
- Rolling Updates: Apply patches and upgrades without interrupting active analysis sessions
- Disaster Recovery: Configurable replication across geographic regions with sub-5 minute recovery time objectives
- High-Frequency Trading Firms: Detect institutional order flow in real-time to anticipate short-term price movements
- Options Traders: Identify gamma exposure changes through order flow analysis around key strike prices
- Market Makers: Monitor inventory risk by tracking the net directional flow of executed orders
- Academic Researchers: Study market microstructure and price formation mechanisms with precision-timestamped data
- Retail Traders: Gain institutional-grade insights without the infrastructure investment typically required
Financial Instrument Analysis Disclaimer (2026 Edition): The Order Flow Imbalance Analyzer is a sophisticated data processing and visualization toolkit designed for educational and research purposes. It provides mathematical interpretations of market data but does not constitute financial advice, trading recommendations, or guarantees of future performance. The developers are not registered financial advisors, and users assume full responsibility for any trading decisions made using this software.
Market conditions change rapidly, and past performance of any analytical method does not guarantee future results. The imbalance metrics calculated by this system represent one perspective on market dynamics and should be used in conjunction with other forms of analysis and sound risk management principles. Always test strategies thoroughly in simulated environments before committing capital.
This software may be subject to export controls and may not be available in all jurisdictions. Users are responsible for complying with all applicable local, national, and international regulations governing financial analysis tools and trading activities.
This project is licensed under the MIT License - see the LICENSE file for complete details.
The MIT License grants permission for use, modification, and distribution in both commercial and non-commercial contexts, requiring only that the original copyright notice and permission notice be included in all copies or substantial portions of the software.
We welcome contributions from the quantitative finance community. Please review our contribution guidelines (included in the repository) before submitting pull requests. Areas of particular interest for development include:
- Additional data feed adapters
- Novel imbalance calculation algorithms
- Visualization enhancements for specific trading styles
- Translation improvements for international users
- Performance optimizations for high-frequency applications
Ready to transform how you perceive market dynamics? Begin your order flow analysis journey today.
Latest Stable Release: OFIA Quantum Edition v2.1.0
Release Date: March 15, 2026
File Size: 87.4 MB (Installer) / 214 MB (Complete Package)
Order Flow Imbalance Analyzer (OFIA) β’ Revealing the market's true narrative through microstructure analysis β’ Β© 2026