Back to Projects
GAF TransformationEfficientNet-B3HMM Memory CacheTransformerPPO RLComputer VisionMulti-Modal AIHFTCPU-OptimizedRegime Detection

AI-Native High-Frequency Trading Engine

Multi-modal artificial intelligence trading system integrating Gramian Angular Field transformation with EfficientNet-B3 Convolutional Neural Network backbone, Hidden Markov Model memory cache system for market regime detection, transformer-based multi-asset pattern recognition with cross-asset attention mechanisms, and Proximal Policy Optimization reinforcement learning agent for adaptive strategy selection and position sizing. Demonstrates production-grade operational performance with microsecond-level order book operations (5.3M ops/sec), sub-millisecond total pipeline latency (<1ms), and exceptional memory efficiency (<150MB footprint) through CPU-optimized 4-bit and 8-bit integer quantization techniques.

5.3M ops/sec (<0.2μs)
Order Book Spread
4.4M ops/sec (<0.3μs)
Order Book Mid Price
735K ops/sec (<1.4μs)
Order Book Imbalance
20K+ ops/sec (<50μs)
Signal Generation
7.5K ops/sec (0.14ms)
GAF Transform (120-bar)
7.6K ops/sec (0.13ms)
Data Processing
<1ms (50x target)
Total Pipeline Latency
<150MB (29x better)
Memory Footprint
50-100 assets/core
Scalability

# Methodology

• Hidden Markov Model: Continuously monitors market regimes, detecting shifts between trending, ranging, and volatile states. This regime detection helps the system adapt its strategy parameters in real-time, reducing exposure during unfavorable market conditions.

• Transformer: Processes relationships between different assets, learning how movements in correlated markets might signal opportunities in target instruments through cross-asset attention mechanisms.

• Reinforcement Learning: The Proximal Policy Optimization agent makes final decisions about trade execution and position sizing. It learns from historical performance which combinations of signals work best under specific market conditions, continuously improving its decision-making process.

The ensemble approach combines five distinct strategies:

  1. Regime-Adaptive Mean Reversion: Identifies overbought/oversold conditions, adjusting thresholds based on current market volatility
  2. Crypto Consolidation Breakout: Detects 13-day accumulation patterns in cryptocurrency markets before major moves
  3. Kalman Filter Pairs Trading: Dynamically hedge relationships between correlated assets, updating hedge ratios as market conditions evolve
  4. Order Flow Analysis: Monitors market depth and trade imbalances to identify institutional buying/selling pressure
  5. Time Zone Momentum: Exploits predictable liquidity patterns during major market session overlaps (London/New York)

Risk management is integrated throughout, with position sizing determined by Kelly Criterion optimization and real-time volatility monitoring. The system maintains strict exposure limits and automatically reduces positions during periods of elevated market stress or declining signal quality.

Core Model

EfficientNet-B3 + Hidden Markov Model + Transformer + PPO Reinforcement Learning

# Data Source

Multi-exchange WebSocket feeds (2023-2025): Yahoo Finance, CoinGecko, CoinMarketCap, Coinglass. Real-time order book streams, trade flow, and market data. 120-bar sliding windows for GAF transformation, 30-60 day HMM regime detection, cross-asset correlation matrices for transformer attention.