Installation Guide
Prerequisites
- Docker Desktop (only required if using Redis)
- A supported exchange account with API keys
- Your server’s public IP address (for API whitelisting)
Table of Contents
- Bot Configuration
- API Key Setup
- Redis Setup
- RedisMarketBridge
- Running the Bot
- Troubleshooting
- TradingView Integration
1. Bot Configuration
All configuration is done via the online configurator.
- Open: Configurator
- Select MagicTradeBot
- Configure:
| Section | Purpose |
|---|---|
| Exchanges | Trading pairs + exchange setup |
| Decision Making | Strategy + risk management |
| Signals | Indicators / signal sources |
| Notifications | Telegram, email, webhook alerts |
Export settings:
- Click Export All YAML
- Unzip
- Replace
/settingsfolder in project
magictradebot/
├── settings/ ← replace
├── MagicTradeBot
├── MagicTradeBot.exe
└── .env
2. API Key Setup
🔐 Security: Always use environment variables. Never store API keys in config files.
Whitelist IP
curl ifconfig.me
Add this IP to your exchange API whitelist.
Using .env
BINANCE_API_KEY=your_key
BINANCE_API_SECRET=your_secret
⚠️ Add
.envto.gitignore
3. Redis Setup (Optional)
Required only if Redis is enabled.
Run Redis via Docker
docker run -d \
--name magictradebot-redis \
-p 6379:6379 \
--restart unless-stopped \
redis:latest
Verify
docker exec -it magictradebot-redis redis-cli ping
Expected: PONG
4. RedisMarketBridge
This component feeds live market data into Redis.
⚠️ Exchange + pairs + intervals MUST match the bot config exactly
Steps:
- Configure via configurator
- Export YAML
- Replace
adapters/redismarketbridge/settings
5. Running the Bot
Order of startup
- Start Redis
- Start RedisMarketBridge
- Wait 2 minutes
- Start MagicTradeBot
Linux / macOS
chmod +x MagicTradeBot
./MagicTradeBot
Windows
MagicTradeBot.exe
💡 Run from terminal to see logs
6. Troubleshooting
API Errors
- Check IP whitelist
- Check permissions
- Verify env variables
No market data
- Wait 2 minutes after RedisMarketBridge start
- Check matching config
Redis issues
- Check Docker running
- Port 6379 open
7. TradingView Signal Integration
MagicTradeBot supports external signals from TradingView via webhooks.
How it works
- TradingView sends alerts → webhook
- MagicTradeBot receives signals
- Bot executes trades automatically
Step 1 — Enable Webhook in Bot
In your bot configuration:
- Enable Signals → Webhook
- Copy your webhook URL
Example:
http://your-server:port/webhook
Step 2 — Create TradingView Alert
- Open TradingView chart
- Add your indicator or strategy
- Click Alert
- Enable Webhook URL
- Paste your bot webhook URL
Step 3 — Define Alert Message
Example JSON payload:
{
"symbol": "BTCUSDT",
"action": "buy",
"price": "{{close}}",
"time": "{{time}}"
}
Supported Actions
buysellclose
Important Notes
- Ensure symbol matches bot config exactly
- Use correct timeframe alignment
- Test with small trades first
⚠️ Incorrect payload format = ignored signals
Testing
You can simulate a webhook using:
curl -X POST http://your-server/webhook \
-H "Content-Type: application/json" \
-d '{"symbol":"BTCUSDT","action":"buy"}'
✅ If configured correctly, the bot will execute a trade
💡 For full details, refer to official TradingView integration docs.