Functional Reference
How Intellect FinLab works end-to-end β every major workflow, decision flow, and system behaviour with flow diagrams. From market open to trade close to session wealth accounting.
Every decision in the system is deterministic, auditable, and recoverable. No signal is acted on without passing all risk gates. No trade closes without updating the lifecycle DB. No session ends without reconciling the wealth model against the plan.
Scanner fire T+0ms β Preflight complete T+3ms β SafeLock acquired T+5ms β Strike picked T+8ms β Order submitted T+12ms β Fill confirmed T+35ms β LP armed T+36ms β Telegram alert T+~800ms (async, non-blocking)
| Category | Representative Scanners | Logic Type |
|---|---|---|
| Fibonacci | SPX_FIB_1HR_CALL/PUT Β· ES_FIB_CALL_1HR | State-based β fires while price is in fib zone |
| EMA Cross | SPX_V3_CALL/PUT Β· ES_CALL_V3 Β· NQ_CALL_V3 | Cross-based β fires on the actual cross bar |
| MACD | SPX_10MIN_MACD_UP/DOWN Β· SPX_1HR_MACD_UP | Cross-based β MACD signal line cross |
| Momentum / SMI | SPX_10MIN_MOMENTUM_UP/DOWN Β· SPX_4HR_STOCHASTIC | State-based β SMI Ergodic level threshold |
| ADX / Trend | SPX_ADX_5M Β· ES_ADX_5M | Threshold β ADX > 20 strength gate |
| RSI | SPX_15M_RSI_OVERSOLD | Threshold β RSI level reversal |
| Zone Breakout | SPX_ZONE_BREAKOUT_CALL/PUT Β· ES_ZONE_BREAKOUT | State β price outside consolidation box |
| Trifecta | SPX_EMA21_TRIFECTA_CALL/PUT | Multi-condition AND β EMA21 + MACD + momentum |
| Correlated | SPY_21_200_CALL/PUT Β· VIX_21_200_CALL/PUT | Cross-based on correlated instrument |
If a strategy requires 2+ scanner patterns (e.g. SPX_FIB_1HR_CALL AND SPX_ADX_5M), both must appear in the Signal Pool within scanner_confirmation_window_minutes (default 5 min) of each other. This prevents stale signals from creating false entries.
| # | Gate | Check | Fail Action |
|---|---|---|---|
| 1 | Market Gate | Is the trading gate OPEN? | Block β log MARKET_GATE_CLOSED, alert if configured |
| 2 | Existing Position | No open position in same instrument + direction | Block β DUPLICATE_POSITION logged |
| 3 | Daily Loss Limit | Today's PnL > configured daily loss ceiling | Block β auto-close market gate, CRITICAL alert |
| 4 | Max Open Positions | Open count < configured max | Block β wait for existing position to close |
| 5 | Gamma Exposure | Net gamma within configured upper/lower bounds | Block β GAMMA_OVEREXPOSED |
| 6 | Staleness Guard | Price feed freshness within threshold | Block β STALE_PRICE_FEED |
| 7 | Capital Sufficiency | WealthManager has capital for β₯ 1 contract | Block β INSUFFICIENT_CAPITAL |
| 8 | Option Viability | Greeks loaded, IV not extreme, bid price available | Block β retry after greek freshness |
3:30PM Handling Modes
| Mode | Action | Use When |
|---|---|---|
modify_to_entry | Atomic cancel-replace: moves limit sell to entry + breakeven % (default +1%). Ensures exit at breakeven or better. | Default β protects against late-day reversal |
alert_only | Sends Telegram + email alert only. Sell order unchanged. Operator decides action. | Manual oversight preference |
force_close | Market sell at exactly 3:30PM ET. No price protection. | Risk-limited environments only |
| Exit Pathway | Trigger | Order Type |
|---|---|---|
| Target Hit (T1/T2/T3) | Limit sell placed at entry fills at target price | Limit sell β placed at entry, monitored by LP |
| Trail Stop | V2PositionWatchdog detects reversal below trail threshold | Atomic cancel-replace to stop price |
| EOD Force Close | Rule 5 β 15:55 ET non-negotiable | Market sell β no exceptions |
| Manual Close | Operator presses Close button in dashboard Positions page | Limit sell at mid-price |
| Parameter | Purpose | Recommended |
|---|---|---|
delta_call | Target delta for call strike selection. Higher = more ITM. | 0.30 |
delta_put | Target delta for put strike selection. | 0.25 |
trade_preference | Primary instrument for contract sizing | ES |
contract_months | 0 = 0DTE Β· 1 = weekly Β· 2 = monthly | 0 (0DTE) |
entry_start_time | Earliest allowed entry time (ET) | 09:45 |
entry_end_time | Latest allowed entry (LP handles anything after) | 15:00 |
gamma_upper_bound | Max net gamma β long gamma limit | 0.15 |
gamma_lower_bound | Min net gamma β negative exposure tolerance | β0.10 |
call_side_enabled | Allow call entries without affecting puts | true |
put_side_enabled | Allow put entries without affecting calls | true |
scanner_patterns_call/put β which scanners trigger entry Β· target_profit_pct β exit target (23%) Β· shield β rapid_shield or day_shield Β· wealth_model β capital plan override Β· veera_rules_enabled + individual rule toggles Β· hunterloop.mode β standard or context_plus_trigger Β· priority β evaluation order (1 = highest)
| Parameter | Level | Purpose |
|---|---|---|
enabled | Per-scanner | Enable/disable β disabled scanner emits no signals and no alerts |
cooldown | Per-scanner | Min seconds between fires β overrides timeframe default |
email | Per-scanner | Email alert on fire (subject to global email_all toggle) |
telegram | Per-scanner | Telegram alert on fire (subject to global telegram_all toggle) |
email_all | Global | Master email switch β OFF disables all scanner emails regardless |
telegram_all | Global | Master Telegram switch β OFF disables all scanner Telegrams |
es_only_mode | Global | Restrict to ES / rapid / test scanners only β useful for off-hours |
WM235K β Weekly Progression Example
The Scanner Bot sends scanner fire events to a separate Telegram channel β keeping your main alert channel clean with only trade-critical events (fills, closes, LP triggers). Each bot has its own token and chat ID, independently configurable.
| Dimension | Paper | Live |
|---|---|---|
| IBKR Port | 7497 β TWS paper account | 7496 β TWS live account (real money) |
| Wealth DB | runtime/paper/intellect.db | runtime/live/intellect.db |
| Capital | Virtual β no real risk | Real money β full risk |
| Config DB | Shared β backend/data/config.db | |
| Lifecycle DB | Shared β backend/runtime/intellect_finlab_next.db | |
| Switch via | Config Console β Environment Settings (requires restart) | |
On restart: StartupReconciliation queries TWS for open orders. If BUY was submitted but not confirmed, reconciler checks fill status. If filled, creates BUY_FILLED event and resumes from there. If not filled, marks trade FAILED and cancels.
Lifecycle DB has SELL_SUBMITTED state. On restart: trade reloaded into RuntimeStore, LP daemon restarts, V2PositionWatchdog resumes monitoring. All rules re-arm from current position state.
If trade is CLOSED in lifecycle DB but wealth not yet updated: on startup, PromotionSyncWorker detects unpromoted closed trades and applies wealth updates from the trade diary. Idempotent β safe to run multiple times.
ib_async fires a disconnect event. RuntimeSyncWorker suspends tick processing. LP daemon continues running but in alert-only mode. On reconnect, RuntimeSyncWorker syncs position and order state. Engine resumes automatically.