Trading Signal System - Installation Guide

Step 1: System Requirements

Step 2: Database Setup

1. Create a MySQL database named 'trading_signals'

2. Run the database setup script:

php database_setup.php

3. Update database credentials in config.php

Step 3: Python Dependencies

Install required Python packages:

pip3 install MetaTrader5==5.0.45
pip3 install mysql-connector-python==8.2.0
chmod +x execute_order.py

Step 4: Security Configuration

1. Change the encryption key in config.php

2. Update the API key in api.php

3. Change default admin password after first login

define('ENCRYPTION_KEY', 'your-unique-32-character-key-here');
$valid_api_key = 'your-secret-api-key-here';

Step 5: File Permissions

chmod 755 *.php
chmod 755 pages/
chmod +x execute_order.py
chmod 666 maintenance.log (create empty file first)

Step 6: Cron Job Setup (Optional)

Add this to your crontab for automatic maintenance:

# Run every hour to clean expired orders
0 * * * * /usr/bin/php /path/to/your/site/cron_monitor.php

⚠️ Important Security Notes

Step 7: First Time Setup

  1. Visit login.php and login with: admin/admin123
  2. Go to "Manage Accounts" and add your MT5 accounts
  3. Test with a small trade signal first
  4. Monitor the "View Orders" page for execution status

✅ API Usage Examples

Send Signal via API:

curl -X POST "http://bot.trade1plus.lk/api.php" \
  -d "api_key=your-secret-api-key" \
  -d "action=send_signal" \
  -d "symbol=EURUSD" \
  -d "action_type=BUY" \
  -d "lot=0.01" \
  -d "sl=1.1000" \
  -d "tp=1.1100"

Troubleshooting