Add export-to-browser utility
- export-report-html.py: Converts MT5 report to clean, styled HTML - export-to-browser.sh: Wrapper script for easy usage - Generates beautiful HTML report viewable in any browser - Includes performance summary, trade stats, and risk metrics
This commit is contained in:
38
export-to-browser.sh
Executable file
38
export-to-browser.sh
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/bin/bash
|
||||
# export-to-browser.sh - Export MT5 report to browser-viewable HTML
|
||||
# Usage: ./export-to-browser.sh [path/to/report.html]
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
# Colors
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m'
|
||||
|
||||
echo -e "${BLUE}=== MT5 Report to Browser Export ===${NC}"
|
||||
echo ""
|
||||
|
||||
# Run the Python exporter
|
||||
if [ -f "${SCRIPT_DIR}/export-report-html.py" ]; then
|
||||
OUTPUT=$(python3 "${SCRIPT_DIR}/export-report-html.py" "$@" 2>&1)
|
||||
echo "$OUTPUT"
|
||||
|
||||
# Extract the output file path
|
||||
OUTPUT_FILE=$(echo "$OUTPUT" | grep "Report exported to:" | sed 's/.*exported to: //')
|
||||
|
||||
if [ -n "$OUTPUT_FILE" ] && [ -f "$OUTPUT_FILE" ]; then
|
||||
echo ""
|
||||
echo -e "${GREEN}✅ Export complete!${NC}"
|
||||
echo ""
|
||||
echo "To view in browser:"
|
||||
echo " 1. Copy the HTML file to your local machine"
|
||||
echo " 2. Open it in any web browser"
|
||||
echo ""
|
||||
echo "Or on this server with a text browser:"
|
||||
echo " lynx $OUTPUT_FILE"
|
||||
echo " w3m $OUTPUT_FILE"
|
||||
fi
|
||||
else
|
||||
echo "❌ export-report-html.py not found"
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user