Skip to Content
Signals ScrapperConfiguration

Configuration

All configuration is provided by environment variables (loaded from .env) and validated with Zod at startup (src/config/sources.schema.ts). Invalid configuration fails fast — the process exits rather than running with a broken setup.

Sources

VariableRequiredPurpose
SOURCESYesJSON array of { type, url } where type is TRADING_CENTRAL or AUTOCHARTIST. Invalid JSON fails startup.

Browser / CDP

VariableDefaultPurpose
BROWSER_MODECDPCDP (attach to a running Chrome — required for Trading Central) or PERSISTENT.
CDP_ENDPOINThttp://127.0.0.1:9222DevTools Protocol endpoint to attach to.
CDP_AUTO_STARTtrueLet the bot launch Chrome if no CDP endpoint is reachable.
CDP_STARTUP_TIMEOUT_MS20000How long to wait for a launched Chrome to expose CDP.
USER_DATA_DIR./.chrome-profileDedicated Chrome profile dir (Chrome 136+ requires a non-default one).
HOST_OSAUTOAUTO / MACOS / WINDOWS — controls Chrome discovery.
CHROME_EXECUTABLE_PATHExplicit Chrome binary path if auto-discovery can’t find it.
HEADLESSfalseRun Chrome headless (leave false for an interactive login session).
NAV_TIMEOUT_MS30000Navigation timeout.
CONTENT_WAIT_MS10000Wait after navigation for the Recognia iframe content to settle.

Scheduling

VariableDefaultPurpose
SIGNAL_CRON_EXPRESSION0 * * * *When to screenshot + extract signals (legacy fallback: CRON_EXPRESSION).
AUTH_REFRESH_CRON_EXPRESSION*/5 * * * *When to reload the authenticated tabs to keep the session alive.

A single-active-task guard ensures a refresh never interrupts an in-progress extraction.

OpenAI (vision extraction)

VariableDefaultPurpose
OPENAI_API_KEYRequired when any TRADING_CENTRAL source exists.
OPENAI_MODELgpt-5.6-lunaModel id used for extraction. This is the shipped default in .env.example; verify it against the model you intend to run.
OPENAI_TIMEOUT_MS60000Request timeout.

Output & state

VariableDefaultPurpose
IDEAS_LOG_PATH./data/ideas.jsonlJSONL log of new ideas (one per line).
SCREENSHOT_DIR./data/screenshotsWhere page screenshots are written.
SEEN_STATE_PATH./data/seen.jsonVersioned dedup state (hashes, signals, debug runs, MT5 outbox).
SEEN_MAX_ENTRIESCap on retained seen entries (pruned, protecting in-flight MT5 hashes).
DEBUG_RUN_MAX_ENTRIES100Cap on retained debug run history.

MT5 execution (optional)

Forwarding to MT5 Trader uses a two-switch safety model: this bot’s MT5_SIGNAL_TRADING_ENABLED and the sibling service’s own TRADING_ENABLED must both be true. While disabled here, no outbox backlog is created.

VariableDefaultPurpose
MT5_SIGNAL_TRADING_ENABLEDfalseMaster switch for forwarding signals to MT5 Trader.
MT5_SIGNAL_API_URLhttp://127.0.0.1:8000MT5 Trader base URL (loopback).
MT5_SIGNAL_API_KEYSent only as X-API-Key; must be ≥16 chars when enabled.
MT5_SIGNAL_TIMEOUT_MS70000HTTP timeout for MT5 calls.
MT5_EXECUTION_MAX_ENTRIES5000Cap on retained outbox entries.
MT5_SIGNAL_RULESJSON map of instrument → { symbol, volume }; required non-empty when enabled.

MT5_SIGNAL_RULES maps IC Markets instruments (e.g. EUR/USD) to exact broker symbols and lot sizes (e.g. { "symbol": "EURUSD", "volume": "0.10" }). Only mapped instruments are eligible for forwarding.

Last updated on