Alpha Research5
Component Architecture
Companion to: Alpha_Research (Strategy Logic) → This page (Code Implementation)
This documentation maps trading philosophy to executable code. Each component translates concepts like "Fab Four", "Color Change", and "Probability Zones" into Python functions.
For Developers: You don't need trading experience. Each section explains the "why" in plain terms before the "how" in code.
System Data Flow
Data flows bottom-up through six layers. Each layer enriches the data before passing it upstream:
┌─────────────────────────────────┐
│ trade_execution_engine.py │ ← Layer 6: Execute & Manage
│ "Pull the trigger" │
└─────────────────────────────────┘
▲
┌─────────────────────────────────┐
│ signal_generation_trade_mgmt │ ← Layer 5: Decide Trade/Skip
│ "Color Change = GO signal" │
└─────────────────────────────────┘
▲
┌─────────────────────────────────┐
│ setup_quality_detection.py │ ← Layer 4: Grade the Setup
│ "A+ gets 2 lots, C gets 1" │
└─────────────────────────────────┘
▲
┌─────────────────────────────────┐
│ market_state_analysis.py │ ← Layer 3: Where Are We?
│ "Fab Four zone, top third" │
└─────────────────────────────────┘
▲
┌─────────────────────────────────┐
│ multi_timeframe_analysis.py │ ← Layer 2: Aggregate Views
│ "1min → 5min → 15min align" │
└─────────────────────────────────┘
▲
┌─────────────────────────────────┐
│ trend_analysis_core.py │ ← Layer 1: Foundation
│ "45-degree or flattish?" │
└─────────────────────────────────┘
▲
Raw OHLC Data
Component Index
| Layer | Component | Trading Concept | Status |
|---|---|---|---|
| 1 | trend_analysis_core.py | 45-degree angle, MA slopes, "big bar by big bar" | → Details |
| 2 | multi_timeframe_analysis.py | MTF alignment, timeframe confluence | → Details |
| 3 | market_state_analysis.py | Fab Four zone, probability zones (halves/thirds) | → Details |
| 4 | setup_quality_detection.py | 5-factor grading, A+ criteria, penalties | → Details |
| 5 | signal_generation_trade_management.py | Color change, direction, gate filters | → Details |
| 6 | trade_execution_engine.py | Entry, stop (Fab Four zone), target (cut in half) | → Details |
Trading Concept Quick Reference
For developers unfamiliar with trading terminology:
| Term | Plain English | Where Used |
|---|---|---|
| Fab Four | Zone between 21-period and 200-period moving averages. Tight zone = potential explosive move. | Market State, Stop Loss |
| Color Change | When short-term trend overtakes long-term (like red line crossing green). RED over GREEN = go SHORT. | Signal Generation |
| 45-degree angle | Healthy trend angle. Too steep = unsustainable. Flattish = no trend. | Trend Analysis |
| Halves/Thirds | Divide price range into zones. Top third = 80% continuation probability. Bottom third = 15%. | Market State, Probability |
| Crash Bar | A bar much larger than recent bars. Indicates structural break - prior levels invalidated. | Trend Analysis |
| Traffic Jam | Prior day's price congestion. Acts as support/resistance. | Market State |
| Cut the Move in Half | Target = 50% of the prior move. Conservative profit taking. | Trade Execution |
| Big Bar by Big Bar | Near MAs, only react to significant price bars, ignore small noise bars. | Trend Analysis |
Component Details
Trend Analysis Core
TODO: Link to Component:Trend_Analysis
Multi-Timeframe Analysis
TODO: Link to Component:MTF_Analysis
Market State Analysis
TODO: Link to Component:Market_State
Setup Quality Detection
TODO: Link to Component:Setup_Quality
Signal Generation
TODO: Link to Component:Signal_Generation
Trade Execution
TODO: Link to Component:Trade_Execution