First-Time Setup Guide
Before starting MagicTradeBot for the first time, a small set of mandatory and recommended settings must be configured to ensure the bot starts correctly, connects securely to your exchange, and operates without errors.
MagicTradeBot is designed with safe defaults, so you do not need to configure every file upfront. The steps below cover the minimum required and recommended setup for a smooth first run.
1. Configure the Exchange in application.yaml
You must specify which exchange MagicTradeBot will connect to.
Exchange:
Name: "bybit"
Supported Exchanges:
- Binance
- Bybit
- OKX
- Bitget
- Hyperliquid
⚠️ Important: Each exchange has strict position-mode requirements (One-Way vs Hedge). Make sure your exchange account is configured accordingly before running the bot.
2. Set Exchange API Credentials (Required)
MagicTradeBot needs API access to place and manage trades.
Recommended Method: Environment Variables (Best Practice)
Using environment variables is strongly recommended, especially for production, because:
- API keys are not stored in files
- Keys are safer and easier to rotate
- Environment variables automatically override YAML values
Environment Variable Setup by OS
✅ Windows (PowerShell)
setx BINANCE_API_KEY "your_api_key_here"
setx BINANCE_API_SECRET "your_api_secret_here"
Restart the terminal (or system) after setting variables.
✅ Linux / macOS (Terminal)
export BINANCE_API_KEY="your_api_key_here"
export BINANCE_API_SECRET="your_api_secret_here"
To make them permanent, add the lines to:
- ~/.bashrc
- ~/.zshrc
- Your shell profile file
✅ Docker / Docker Compose
environment:
- BINANCE_API_KEY=${BINANCE_API_KEY}
- BINANCE_API_SECRET=${BINANCE_API_SECRET}
Supported Environment Variable Names
Examples:
- BINANCE_API_KEY, BINANCE_API_SECRET
- BYBIT_API_KEY, BYBIT_API_SECRET
- OKX_API_KEY, OKX_API_SECRET, OKX_PASSPHRASE
- BITGET_API_KEY, BITGET_API_SECRET, BITGET_PASSPHRASE
- HYPERLIQUID_PRIVATE_KEY
🔐 Never enable withdrawal permissions on API keys.
3. Provide Your License Key
In application.yaml:
License:
Key: "your_license_key_here"
How to Get Your License Key
- Log in to https://magictradebot.com
- Go to Downloads
- Copy your license key
Important Notes
- The bot can still run without a license
- However, features will be limited
- License validation happens at startup
4. Review Basic Trading Settings (trading.yaml)
For first-time users, this file does not require mandatory changes.
You may optionally review or adjust:
- Initial trading amount
- Default leverage
- Risk limits
If unsure, leave defaults — they are safe for initial runs and demo mode.
5. First-Time Symbol & Leverage Setup (Very Important)
Step 1: Enable Symbol Sync (First Run Only)
In trading.yaml (or symbol configuration file):
SyncSymbolsOnStartup: true
This will:
- Fetch all supported symbols from the exchange
- Create or update symbols.json
- Remove delisted symbols
- Add newly listed symbols
➡️ Run the bot and wait until symbol sync completes
➡️ Monitor the symbols.json file
➡️ Stop the bot once sync is done
Step 2: Disable Symbol Sync (Optional)
After first sync, you can set:
SyncSymbolsOnStartup: false
If you want automatic symbol updates, keep it true permanently.
Step 3: One-Time Leverage Setup (Optional but Recommended)
If you want MagicTradeBot to configure leverage automatically:
SetLeverageStartup: true
SetMaxLeverage: false
- This applies your configured leverage (e.g., 10x) to all supported symbols
- Run the bot once
- Wait a few minutes for leverage updates
- Then set both options back to false
⚠️ Do NOT leave these enabled permanently, or leverage will be reset on every restart.
Max Leverage (Scalping Use Case)
If you want maximum exchange-allowed leverage:
SetMaxLeverage: true
Use this only once, then disable again.
6. Choose Symbols to Trade (Optional)
You can:
- Trade all synced symbols (500+)
- Or restrict trading to selected symbols only
Example:
BTCUSDT
ETHUSDT
SOLUSDT
XRPUSDT
If trading all symbols, keep:
SyncSymbolsOnStartup: true
7. Configure Notifications (Highly Recommended)
Set up at least one notification channel in notification.yaml:
- Telegram
- Discord
This allows you to receive:
- Trade executions
- Errors and failures
- Market Watch alerts
- Emergency events
Running without notifications is possible, but not recommended.
Final Checklist (First Run)
Before starting MagicTradeBot, ensure:
- ✅ Exchange selected in application.yaml
- ✅ API credentials set (preferably via environment variables)
- ✅ License key added (optional but recommended)
- ✅ Symbol sync enabled for first run
- ✅ Optional leverage setup completed once
- ✅ Notification channel configured
That’s it.
No other configuration is required to start trading safely and correctly.