L3 โ Components
C4 Level 3: Zooms into the key containers and shows their internal modules, classes, and responsibilities.
C4 Model โ Level 3
The Component diagram answers: What are the major structural elements inside each container?
Analysis Engine โ Component Diagramโ
Signal Generator โ Component Diagramโ
Data Ingestor โ Component Breakdownโ
| Component | Responsibility |
|---|---|
| Source Router | Selects primary/fallback data source per symbol |
| REST Poller | Fetches 1m candles from REST API on schedule |
| WS Stream Client | Maintains WebSocket connection for real-time tick data |
| Normaliser | Maps source-specific field names โ unified OHLCV schema |
| Gap Detector | Identifies missing candles, triggers backfill |
| Backfiller | Fetches historical data to fill detected gaps |
| Rate Limiter | Tracks and respects per-API-key rate limits |
| Health Reporter | Emits data freshness metrics; alerts on stale data |
Confluence Scoring โ Detailโ
# Scoring weights (sum = 1.0)
WEIGHTS = {
'trend_alignment': 0.30, # EMA cross, MACD, ADX
'momentum': 0.25, # RSI, Stochastic, CCI
'volume': 0.20, # VWAP, OBV
'pattern': 0.15, # Candlestick / chart patterns
'key_level': 0.10, # Support/resistance proximity
}
MINIMUM_CONFLUENCE = 0.65 # Hard threshold
MINIMUM_RR_RATIO = 1.5 # Risk/reward hard floor
MAX_DAILY_SIGNALS = 3 # Hard daily cap
MAX_HOLD_MINUTES = 30 # Hard position time limit