Skip to main content

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โ€‹

ComponentResponsibility
Source RouterSelects primary/fallback data source per symbol
REST PollerFetches 1m candles from REST API on schedule
WS Stream ClientMaintains WebSocket connection for real-time tick data
NormaliserMaps source-specific field names โ†’ unified OHLCV schema
Gap DetectorIdentifies missing candles, triggers backfill
BackfillerFetches historical data to fill detected gaps
Rate LimiterTracks and respects per-API-key rate limits
Health ReporterEmits 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