
Basic Setup Instructions
& User Guide:
(detailed, step by step instructions will come with your purchase)
Setup and Installation Guide for the Crypto Trading Bot
### Step-by-Step Instructions to Set Up and Run the Crypto Trading Bot
These instructions assume you have Python 3.8 or higher installed on your machine (download from python.org if not). The bot runs on Windows or Linux. The companion Android app is provided as a pre-compiled .apk file, which you'll install separately on your phone. The bot handles crypto trading on Binance, so you'll need a Binance account with API keys enabled.
#### Step 1: Prepare Your System
- Download the bot files: Get the zip or repo containing `trading_bot.py`, `server.py`, `setup.py`, and any other supporting files (e.g., requirements.txt if provided).
- Extract to a folder, e.g., `C:\crypto_bot` on Windows or `~/crypto_bot` on Linux.
- Install Python if missing: Go to python.org, download the installer for your OS, and follow the prompts. Ensure "Add Python to PATH" is checked on Windows.
#### Step 2: Get Binance API Keys
- Log in to your Binance account (create one at binance.com if you don't have it).
- Go to the API Management section (under your profile > API Management).
- Create a new API key: Label it (e.g., "Trading Bot"), enable "Spot & Margin Trading" permissions, and note any IP restrictions (remove if testing locally).
- Copy the API Key and Secret—they look like long strings. Keep them secure; don't share.
- Fund your Binance spot wallet with USDT or other assets for trading.
#### Step 3: Generate an AUTH_TOKEN
- The AUTH_TOKEN secures communication between the app and bot server. Generate a strong, random one (32+ characters, mix letters/numbers/symbols).
- Use an online tool like https://passwordsgenerator.net/ (set to 32 chars, include symbols) or Python:
1. Open a terminal/command prompt.
2. Run: `python -c "import secrets; print(secrets.token_hex(16))"` (this generates a 32-char hex token).
- Copy the token— you'll use it in the .env file and app.
#### Step 4: Run the Setup Script
- Open a terminal/command prompt in your bot folder (e.g., `cd C:\crypto_bot`).
- Run: `python setup.py`
- This creates a virtual environment (`bot_env`), installs dependencies (ccxt, dotenv, etc.), and generates a .env template.
- If errors occur (e.g., missing pip), ensure Python is in your PATH and retry.
#### Step 5: Configure the .env File
- Open the new `.env` file in a text editor (e.g., Notepad on Windows).
- Fill in:
```
BINANCE_API_KEY=your_binance_api_key_here
BINANCE_API_SECRET=your_binance_api_secret_here
AUTH_TOKEN=your_generated_auth_token_here
```
- Save the file. This secures your credentials—never share .env.
#### Step 6: Activate the Virtual Environment and Start the Bot
- Activate the venv:
- Windows: `bot_env\Scripts\activate`
- Linux: `source bot_env/bin/activate`
- Run the bot: `python trading_bot.py`
- It will start the server (on port 5000) and bot loop. Check the console for logs (e.g., "Bot running...").
- The bot uses simulated trading by default (LIVE_TRADING=False in config.json). Edit config.json or use the app to enable live trading later.
#### Step 7: Install and Set Up the Android App (Optional, for Remote Control)
- Transfer the .apk file to your Android phone and install it (enable "Unknown Sources" in Settings > Security if prompted).
- Open the app (CryptoForge).
- In the Dashboard tab > Server Settings (hold to edit):
- Server URL: If local (same network), use `http://your_computer_ip:5000` (find IP with `ipconfig` on Windows or `ifconfig` on Linux).
- Auth Token: Paste your AUTH_TOKEN from .env.
- Save and test—app should connect and show bot status.
#### Step 8: Accessing the Bot Remotely with the App (If Bot is at Home)
- For local access (phone/computer on same Wi-Fi): Use the internal IP as above (e.g., `http://192.168.1.100:5000`).
- For remote access (phone outside home network):
- Use Ngrok: Install Ngrok (ngrok.com), run `ngrok http 5000` on your bot machine. Copy the forwarding URL (e.g., `https://abc123.ngrok.io`) and enter it in the app's Server URL.
- Port Forwarding (Advanced): In your router settings, forward port 5000 to your computer's IP. Use your public IP (whatismyip.com) in the app as `http://your_public_ip:5000`. Caution: This exposes the server—use only if comfortable with security risks.
- Always test connection: In app, refresh Dashboard—if it shows "Bot Status: Running", it's connected.
#### Troubleshooting
- Bot not starting? Check trading_bot.log for errors (e.g., invalid API keys).
- App connection fails? Verify AUTH_TOKEN matches .env, server is running, and URL is correct (http not https unless using Ngrok/SSL).
- Windows issues? Run terminals as admin if permissions errors.
- For help, check console logs or community forums.
Once set up, use the app's Config tab to tweak strategies, enable live trading (PIN-protected), and monitor positions/trades. Happy trading—start in simulation mode!