Skip to Content
Telegram → MT5Configuration

Configuration

Copy .env.example to .env and edit. Values below match the sample file.

Telegram

VariableDefault / exampleDescription
TELEGRAM_API_IDFrom https://my.telegram.org 
TELEGRAM_API_HASHFrom https://my.telegram.org 
TELEGRAM_PHONE_NUMBERUser account phone
TELEGRAM_SESSION_PATH./state/telegram.sessionSession file path (login writes this)
TELEGRAM_SESSION_STRINGOptional string session instead of a file
CHAT_ID@blacktradeSource chat (@name, bare name, numeric, or -100…)

Treat the session file or TELEGRAM_SESSION_STRING like a password.

MetaTrader 5

VariableDefaultDescription
MT5_TERMINAL_PATHPath to the MT5 terminal executable
MT5_LOGINOptional; leave blank to use the terminal’s active account
MT5_PASSWORDOptional account password
MT5_SERVEROptional broker server
MT5_TIMEOUT_MS60000Terminal init timeout

Trading safety

VariableDefaultDescription
LIVE_TRADING_ENABLEDfalseOrders are never sent unless true
DEFAULT_VOLUME0.01Fixed lot size
MAX_DEVIATION_POINTS20Max deviation
ORDER_MAGIC240710MT5 magic number
SYMBOL_MAP_JSON{"GOLD":"XAUUSD",…}JSON map from signal symbols to broker symbols

Polling & runtime

VariableDefaultDescription
POLL_INTERVAL_SECONDS5Poll interval
POLL_MAX_MESSAGES50Max messages per poll
STATE_DIR./stateCursor, handled keys, session file
LOGS_DIR./logsJSONL logs
LOG_LEVELINFOLog level
LOG_RAW_MESSAGESfalseWhen true, write raw.jsonl
HTTP_HOST127.0.0.1Health HTTP bind host
HTTP_PORT8091Health HTTP bind port
Last updated on