EVENT FLOW — MULTI-ENGINE TREND SYSTEM VERSION: 2.0 FORMAT: PLAIN TEXT (WORD-SAFE) ----------------------------------------- ONINIT EVENT ----------------------------------------- 1. Load configuration file 2. Initialize PortfolioController 3. Initialize all TrendEngine instances 4. Initialize monitoring modules 5. Initialize timers (health checks, alerts) 6. Log "System initialised" ----------------------------------------- ONTICK EVENT ----------------------------------------- 1. PortfolioController.UpdateRiskState() 2. PortfolioController.UpdateRiskScaling() 3. For each TrendEngine: a. UpdateIndicators() b. ClassifyVolatility() c. If SessionAllowed() == false → skip d. If volRegime == CHAOTIC → skip e. If activationDelayPassed == false → skip f. If inPosition: - UpdateStops() - HandlePyramiding() - continue g. TryEnter() 4. Monitoring: a. Engine-level health checks b. Portfolio-level exposure checks c. Execution quality checks 5. Alert system: a. Trigger warnings b. Trigger critical alerts c. Log events ----------------------------------------- ONTIMER EVENT (EVERY X SECONDS) ----------------------------------------- 1. Check VPS uptime 2. Check API connectivity 3. Check clock drift 4. Check data feed health 5. Auto-pause engines if required 6. Auto-resume if conditions normalise 7. Log monitoring results ----------------------------------------- ONDEINIT EVENT ----------------------------------------- 1. Close pending orders 2. Save state if required 3. Log shutdown event 4. Release objects ----------------------------------------- END OF EVENT FLOW