Skip to Content
IPDAConfiguration

Configuration

Copy .env.example.forex to .env (or .env.forex with --profile forex) and fill it in. For Deriv, copy .env.example.deriv to .env.deriv and run with --profile deriv.

Key variables

VariablePurpose
DATA_API_URL, DATA_API_KEY, DATA_LOOKBACKMarket-data endpoint, auth, and warmup window
QUOTE, MT5_SYMBOLSingle instrument (legacy; omit when using SYMBOLS_FILE)
SYMBOLS_FILEJSON manifest of instruments to research and trade in one process
POLL_INTERVAL_SECONDSPoll cadence (keep < 60s for mid-candle firing)
TARGET_TF_MINUTES, BUCKET_OFFSET_MINUTESStrategy timeframe (default 5) and bucket alignment
REVERSAL_SENSITIVITY, REVERSAL_OVERSOLD, REVERSAL_OVERBOUGHTLive RSI trigger (defaults 14 / 25 / 75)
SUPERTREND_SENSITIVITY, SUPERTREND_ATR_LEN, SMA_LEN, RISK_REWARDUnused unless Supertrend strategy is switched on in code (defaults 5.5 / 11 / 13)
SEND_STOP_LOSS, SEND_TAKE_PROFIT, PRICE_DIGITSExit toggles and rounding
USE_HARD_TARGETS, STOP_LOSS_PIPS, TAKE_PROFIT_PIPS, PIP_SIZEMust keep hard targets true; forex 40/50; set PIP_SIZE explicitly
TRADING_SESSIONS, SESSION_TOKYO, SESSION_NEW_YORKSession gate — see Sessions
NOTIFICATIONS_ENABLED, NOTIFICATION_SERVICE_URL, NOTIFICATION_API_KEYnotification-service client
NOTIFICATION_CHANNELS, NOTIFICATION_TIMEOUT_SECONDSChannels (e.g. TELEGRAM) and HTTP timeout
TRACK_OPEN_TRADES, MFE_BREAK_EVEN_PIPS, TRACKED_TRADE_TTL_HOURSBreak-even advisory — see Break-even
VOLUME, DEVIATION_POINTS, IGNORE_SIGNAL_AGEOrder defaults (per-instrument overrides in SYMBOLS_FILE)
MT5_SIGNAL_API_URL, MT5_SIGNAL_API_KEY, REQUIRE_READYmt5-trader connection
LOG_LEVEL, LOGS_DIR, MAX_RETRIES, RETRY_BASE_DELAY_MSRuntime

There are no confluence or veto environment variables.

USE_HARD_TARGETS must be true (startup fails otherwise) and PIP_SIZE must be set explicitly. Inverted reversal levels also fail at startup. See Hard Targets.

Market-data contract

By default DATA_API_URL targets mt5-trader’s GET /v1/market-data/candles, which returns:

{ "symbol": "...", "timeframe": "...", "candles": [ {"time": 0, "open": 0, "high": 0, "low": 0, "close": 0, "volume": 0} ] }

(time is epoch-seconds; volume is integer.) This is parsed out of the box.

Set DATA_API_KEY to the same value as mt5-trader’s API_KEY — that endpoint requires X-API-Key auth. QUOTE must be one of mt5-trader’s ALLOWED_SYMBOLS.

The data endpoint’s response schema is not otherwise fixed: data_client.parse_candles also accepts a list of objects or arrays and common field aliases / timestamp encodings. Adjust the alias tuples in src/data_client.py if your feed differs, and set DATA_QUOTE_PARAM / DATA_COUNT_PARAM to match its query parameters.

Last updated on