Legend
- Red nodes → Blocking decisions
- Green nodes → Source-of-truth operations
- Yellow nodes → Warning/flag states
Consistency Rule Calculation
- Best Day Cap:
profit_target_dollars * consistency_best_day_pct (default: 50%)
- Buffered Cap:
bestDayCapUsd * consistency_buffer_pct (default: 98%)
- Soft Threshold:
bestDayCapBufferedUsd * consistency_soft_threshold_pct (default: 85%)
Trading Session Boundary
- Session Start: 5:00 PM ET (configurable:
trading_day_start_hour=17)
- Timezone: America/New_York (handles DST automatically)
- Calculation: Uses Luxon
DateTime for timezone-aware date math
- Session Day Key: ISO date of current trading session
Mode Behavior
- hard_block: Blocks entries at soft threshold
- no_new_entries: Blocks entries at soft threshold
- disable_pyramiding: Allows entries but disables pyramiding at soft threshold
Example
- Profit Target: $9,000
- Best Day Cap: $4,500 (50%)
- Buffered Cap: $4,410 (98% of $4,500)
- Soft Threshold: $3,748.50 (85% of $4,410)
- If
realizedPnLToday = $4,400: Entry blocked (above buffered cap)
- If
realizedPnLToday = $3,800: Entry blocked if hard_block or no_new_entries, or allowed with pyramiding disabled if disable_pyramiding