#!/bin/bash # create-live-report.sh - Create HTML report from live MT5 data (screenshot/terminal) # Usage: ./create-live-report.sh [profit_amount] [balance] [trades] SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Colors GREEN='\033[0;32m' BLUE='\033[0;34m' YELLOW='\033[1;33m' NC='\033[0m' echo -e "${BLUE}=== Create Live Trading Report ===${NC}" echo "" # Get current data from screenshot or user input if [ -z "$1" ]; then echo "Enter current trading data from your MT5 terminal:" echo "" read -p "Current Profit (e.g., 6935.12): " PROFIT read -p "Current Balance (e.g., 106935.12): " BALANCE read -p "Total Trades (e.g., 45): " TRADES read -p "Account Number (default: 104125640): " ACCOUNT ACCOUNT=${ACCOUNT:-104125640} else PROFIT=$1 BALANCE=${2:-$((100000 + PROFIT))} TRADES=${3:-45} ACCOUNT=${4:-104125640} fi # Validate if [ -z "$PROFIT" ] || [ -z "$BALANCE" ]; then echo "❌ Error: Profit and Balance are required" exit 1 fi # Create Python script to generate report python3 << EOFPY import os from datetime import datetime profit = float("${PROFIT}") balance = float("${BALANCE}") trades = int("${TRADES}") account = "${ACCOUNT}" starting = 100000.00 return_pct = (profit / starting) * 100 html_content = f''' MT5 Live Trading Report - Account {account}

📊 MT5 LIVE Trading Report

Account {account} | Generated: {datetime.now().strftime('%Y-%m-%d %H:%M')}

● LIVE DATA FROM TERMINAL
{'+' if profit > 0 else ''}${profit:,.2f}
Current Profit
${starting:,.2f}
Starting Balance
${balance:,.2f}
Current Balance
{return_pct:.2f}%
Total Return
{trades}
Total Trades
''' timestamp = datetime.now().strftime('%Y%m%d-%H%M%S') output_file = os.path.expanduser(f"~/mt5-live-report-{account}-{timestamp}.html") with open(output_file, 'w', encoding='utf-8') as f: f.write(html_content) print(f"✅ Live report created: {output_file}") EOFPY echo "" echo -e "${GREEN}✅ Report created successfully!${NC}" echo "" echo "To view in browser:" echo " 1. Copy the HTML file to your local machine" echo " 2. Open in any web browser" echo "" ls -la ~/mt5-live-report-*.html 2>/dev/null | tail -1