This guide explains how to configure SignalTrader for your trading setup. The configuration is stored in a JSON file that defines all necessary parameters for provider integration (Telegram, etc.), MetaTrader connection, and trading behavior.
- Create a
settings.jsonfile in the project root (or next to the executable for releases) - Copy the sample configuration below and modify the values for your setup
- Ensure all required fields are filled correctly
- Visit https://my.telegram.org/auth
- Log in with your phone number
- Go to "API development tools"
- Create a new application to get
api_idandapi_hash
- Start a chat with @RawDataBot on Telegram
- Send any message to get your chat ID
- Use this ID in the
Notification.chatIdfield
- Obtain server address, username, and password from your broker
- Ensure MetaTrader 5 terminal is installed and running
{
"providers": {
"telegram": {
"api_id": 12345678,
"api_hash": "abcdef1234567890abcdef1234567890",
"channels": {
"whiteList": ["trading_signals_channel", "forex_signals"],
"blackList": ["spam_channel", "unreliable_signals"]
}
}
},
"Notification": {
"token": "1234567890:ABCdefGHIjklMNOpqrsTUVwxyz123456789",
"chatId": 123456789
},
"MetaTrader": {
"server": "YourBroker-Server",
"username": 123456,
"password": "YourPassword",
"path": "C:/Path/To/MetaTrader/terminal64.exe",
"lot": "2%",
"HighRisk": false,
"SaveProfits": [25, 25, 25, 25],
"AccountSize": 10000,
"CloserPrice": 0.5,
"expirePendinOrderInMinutes": 30,
"ClosePositionsOnTrail": true,
"SymbolMappings": {
"XAUUSD": "XAUUSD",
"EURUSD": "EURUSD"
},
"symbols": {
"whiteList": ["EURUSD", "GBPUSD", "XAUUSD"],
"blackList": ["JPYUSD", "exotics"]
}
},
"Timer": {
"start": "08:00",
"end": "18:00"
},
"disableCache": false
}All providers are configured under the providers section. See PROVIDERS.md for complete provider documentation.
| Field | Type | Required | Description |
|---|---|---|---|
api_id |
number | Yes | Telegram API ID from https://my.telegram.org |
api_hash |
string | Yes | Telegram API hash from https://my.telegram.org |
channels.whiteList |
array | No | Array of allowed channel usernames. If empty, all channels are allowed except blacklisted ones |
channels.blackList |
array | No | Array of blocked channel usernames |
Channel Filtering Logic:
- If
whiteListis not empty, only messages from whitelisted channels are processed blackListalways takes precedence (blocked channels are ignored)- Channel usernames should not include the @ symbol
Example:
{
"providers": {
"telegram": {
"api_id": 12345678,
"api_hash": "your_api_hash",
"channels": {
"whiteList": ["trading_signals", "forex_tips"],
"blackList": []
}
}
}
}| Field | Type | Required | Description |
|---|---|---|---|
token |
string | Yes | Telegram bot token from @BotFather |
chatId |
number | Yes | Chat ID for receiving notifications (use @RawDataBot) |
| Field | Type | Required | Description |
|---|---|---|---|
server |
string | Yes | MetaTrader server address (e.g., "ICMarkets-MT5") |
username |
number | Yes | Trading account number |
password |
string | Yes | Trading account password |
path |
string | Yes | Full path to MetaTrader terminal64.exe |
lot |
string/number | Yes | Position size. Use "X%" for percentage of account, or fixed number |
HighRisk |
boolean | No | Enable dual entry points (default: false) |
SaveProfits |
array | No | Profit saving percentages (default: []) |
AccountSize |
number | No | Account balance override (default: uses MT5 account balance) |
CloserPrice |
number | No | Price adjustment for entries (default: 0) |
expirePendinOrderInMinutes |
number | No | Pending order expiration in minutes (default: no expiration) |
SymbolMappings |
object | No | Map base symbols to broker-specific variants |
ClosePositionsOnTrail |
boolean | No | Whether to close positions during trailing stops (default: true) |
symbols.whiteList |
array | No | Array of allowed trading symbols. If empty, all symbols are allowed except blacklisted ones |
symbols.blackList |
array | No | Array of blocked trading symbols |
Symbol filtering allows you to control which trading instruments the bot will accept signals for:
"symbols": {
"whiteList": ["EURUSD", "GBPUSD", "XAUUSD"],
"blackList": ["JPYUSD", "exotics"]
}Symbol Filtering Logic:
- If
whiteListis not empty, only signals for whitelisted symbols are processed blackListalways takes precedence (signals for blacklisted symbols are ignored)- Symbol names should match the format used in signals (e.g., "EURUSD", "XAUUSD")
- Filtering is case-insensitive
| Field | Type | Required | Description |
|---|---|---|---|
start |
string | No | Trading start time in HH:MM format (24-hour) |
end |
string | No | Trading end time in HH:MM format (24-hour) |
Timer Behavior:
- Trading is only allowed between
startandendtimes - Times should be in 24-hour format (e.g., "08:00", "18:00")
- If timer spans midnight, it will work correctly
Some brokers use different symbol names than standard ones. Use SymbolMappings to handle this:
"SymbolMappings": {
"XAUUSD": "XAUUSDm", // Gold with micro lot suffix
"EURUSD": "EURUSD!", // EURUSD with broker suffix
"US30": "US30" // Dow Jones index
}The SaveProfits array defines partial profit taking levels:
"SaveProfits": [25, 25, 25, 25]This means:
- Take 25% profit at first TP level, close 25% of position
- Take another 25% at second TP level, close another 25%
- And so on...
To disable database caching (for debugging or memory constraints):
"disableCache": falseNote: Disabling cache may impact performance for large position histories
lot: "2%" means 2% of account balance per tradeHighRisk: true enables two entry points for averagingCloserPrice: Adjusts entry price closer to current market price (useful for pending orders)ClosePositionsOnTrail: Controls whether positions are closed during trailing stops. Set to false to only adjust stop losses without closing positions
You can use environment variables for sensitive data:
Create a .env file:
ENV=production
MT5_PASSWORD=your_secure_password
TELEGRAM_API_HASH=your_api_hash
Then reference in settings.json:
{
"providers": {
"telegram": {
"api_hash": "$TELEGRAM_API_HASH"
}
},
"MetaTrader": {
"password": "$MT5_PASSWORD"
},
"api_hash": "$TELEGRAM_API_HASH"
}
}The application will validate your configuration on startup. Common issues:
- Invalid Telegram API credentials
- Incorrect MetaTrader path
- Wrong chat ID format
- Invalid time format in Timer
Check the logs for detailed error messages if startup fails.