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
| Variable | Purpose |
|---|---|
DATA_API_URL, DATA_API_KEY, DATA_LOOKBACK | Market-data endpoint, auth, and warmup window |
QUOTE, MT5_SYMBOL | Single instrument (legacy; omit when using SYMBOLS_FILE) |
SYMBOLS_FILE | JSON manifest of instruments to research and trade in one process |
POLL_INTERVAL_SECONDS | Poll cadence (keep < 60s for mid-candle firing) |
TARGET_TF_MINUTES, BUCKET_OFFSET_MINUTES | Strategy timeframe (default 5) and bucket alignment |
REVERSAL_SENSITIVITY, REVERSAL_OVERSOLD, REVERSAL_OVERBOUGHT | Live RSI trigger (defaults 14 / 25 / 75) |
SUPERTREND_SENSITIVITY, SUPERTREND_ATR_LEN, SMA_LEN, RISK_REWARD | Unused unless Supertrend strategy is switched on in code (defaults 5.5 / 11 / 13) |
SEND_STOP_LOSS, SEND_TAKE_PROFIT, PRICE_DIGITS | Exit toggles and rounding |
USE_HARD_TARGETS, STOP_LOSS_PIPS, TAKE_PROFIT_PIPS, PIP_SIZE | Must keep hard targets true; forex 40/50; set PIP_SIZE explicitly |
TRADING_SESSIONS, SESSION_TOKYO, SESSION_NEW_YORK | Session gate — see Sessions |
NOTIFICATIONS_ENABLED, NOTIFICATION_SERVICE_URL, NOTIFICATION_API_KEY | notification-service client |
NOTIFICATION_CHANNELS, NOTIFICATION_TIMEOUT_SECONDS | Channels (e.g. TELEGRAM) and HTTP timeout |
TRACK_OPEN_TRADES, MFE_BREAK_EVEN_PIPS, TRACKED_TRADE_TTL_HOURS | Break-even advisory — see Break-even |
VOLUME, DEVIATION_POINTS, IGNORE_SIGNAL_AGE | Order defaults (per-instrument overrides in SYMBOLS_FILE) |
MT5_SIGNAL_API_URL, MT5_SIGNAL_API_KEY, REQUIRE_READY | mt5-trader connection |
LOG_LEVEL, LOGS_DIR, MAX_RETRIES, RETRY_BASE_DELAY_MS | Runtime |
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.
Related pages
- Signal Logic — reversal vs Supertrend
- Profiles —
SYMBOLS_FILEand forex/deriv pairing - Sessions —
TRADING_SESSIONSand window specs - Notifications — notification-service wiring
- Break-even — MFE tracker settings
- Warmup & Alignment —
DATA_LOOKBACKand bucket offset - Pine Script — chart settings to match the service