top3-market-context-aware-impovements
I'll scan the Mercury Kairos module to map the current position job lifecycle and queues, then propose top 3 approaches for market timing awareness.
[4 tools called]
I'll locate the Kairos queue names and job types, and read the position execution consumer to map the lifecycle. Then I'll propose the top 3 approaches for market timing awareness.
[4 tools called]
- Checked Kairos queues and consumers to map the job lifecycle. Now proposing top 3 timing-aware approaches.
Top 3 market-timing approaches to add context awareness
- Session quality scoring and gating
- What: Compute a rolling “session quality score” (Asian/Europe/US, hour-of-day), volume/volatility-weighted, with exchange uptime and spread/liquidity checks.
- How to use:
- Validation gate: block or defer VALIDATE_POSITION_CANDIDATE during poor sessions unless high-confidence signal.
- Scheduling: slow SYNC cadence and TPSL recalcs in weak sessions; speed up in strong sessions.
- Integration points:
DynamicTpslConsumer.handleValidatePositionCandidate(...): inject sessionScore into decision; require minimum score to proceed.PositionSchedulerService.schedulePositionSyncJobs()and any candle-delay util: vary cadence by session score.tpsl-helpers.validateTPSLDataSanity(...): enforce larger SL buffers when session score is low.
- Volatility regime controls (ATR/ADX bands) with risk throttling
- What: Classify low/normal/high regimes (ATR percent-of-price, ADX, realized vol) per symbol-timeframe and throttle entries/risk.
- How to use:
- Validation: disallow entries in extreme regimes unless strategy explicitly supports them.
- TPSL shaping: widen SL/bring TPs closer in high-vol; cap reward/risk dynamically.
- Integration points:
TaServiceto compute ATR/ADX; pass regime intoDynamicTPSLServiceand validation output.tpsl-helpers.fixExcessiveRewardRiskRatio(...): make regime-aware caps/floors.PositionExecutionConsumer.handleFinalizePosition(...): guard finalize/open if regime out-of-policy.
- Event risk windows and micro-liquidity guardrails
- What: Maintain a near-term “risk calendar” (economic events, exchange maintenance) plus live micro-liquidity checks (spread, order book depth).
- How to use:
- Validation: block/defer near high-impact events; allow only shadow positions; or reduce size.
- Scheduler: introduce “freeze windows” where only SYNC runs, no new creates/finalizes.
- Integration points:
- Extend validation output with
eventRiskLevelandliquidityOk. PositionFactory/finalize gate: enforce freeze windows for LIVE opens.PositionSchedulerService: schedule deferrals until window passes.
- Extend validation output with
Current position lifecycle (jobs perspective)
-
Queues
KAIROS.dynamic-tpslVALIDATE_POSITION_CANDIDATE: AI validation (pre-entry)CALCULATE_DYNAMIC_TPSL_INIT: initial TP/SL calc for creationCALCULATE_DYNAMIC_TPSL_PERIODIC: recalcs for open positions
KAIROS.position-executionCREATE_POSITION: creates DB entity and opens LIVE position on exchange (storesexchangeOrderLinkId), emits eventFINALIZE_POSITION: finalizes with TPSL and opens LIVE if needed, emits eventSYNC_POSITION: core sync for TP/SL checks, verification, pricing updatesSCHEDULE_POSITIONS: orchestrates scheduling ofSYNC_POSITIONjobs
-
Primary flow
- Candidate →
VALIDATE_POSITION_CANDIDATE(gate: market session/regime/event recommended) - If valid →
CALCULATE_DYNAMIC_TPSL_INIT - →
CREATE_POSITION(orFINALIZE_POSITIONdepending on flow) opens LIVE on exchange and emits event SCHEDULE_POSITIONSperiodically enqueuesSYNC_POSITIONper open position- Optional:
CALCULATE_DYNAMIC_TPSL_PERIODICto adapt levels
- Candidate →
-
Key guard points for timing/context
- Validation step: accept/deny/defer with reason and next-candle delay
- Finalize/open: last-mile gating before touching exchange
- Scheduler: cadence control and freeze windows
Minimal, high-impact implementation plan
-
Add
MarketContextService(session score, regime, event risk, liquidity) consumed by:DynamicTpslConsumer.handleValidatePositionCandidate(...)PositionSchedulerService.schedulePositionSyncJobs(...)PositionExecutionConsumer.handleFinalizePosition(...)
-
Extend validation result/AI decision context with
sessionScore,volRegime,eventRiskLevel. -
Make
tpsl-helpersregime-aware: dynamic R/R caps, SL buffers, TP spacing. -
Adjust scheduler cadence and allow deferrals based on session score and event windows.
-
In short: gate earlier (validation), shape risk (TPSL), and schedule smarter (scheduler).
-
Summary: Proposed 3 timing-aware layers (session scoring, volatility regimes, event/liquidity guardrails) and mapped where to inject them across validation, finalize/open, and scheduling for a robust market context pipeline.