Files
2025-12-26 18:24:56 +03:30

679 lines
25 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>FxMathQuant User Manual</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', sans-serif;
line-height: 1.6;
color: #333;
background: #f5f7fa;
padding: 20px;
}
.container {
max-width: 900px;
margin: 0 auto;
background: white;
padding: 40px;
border-radius: 10px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
h1 {
color: #667eea;
font-size: 2.5em;
margin-bottom: 10px;
border-bottom: 3px solid #667eea;
padding-bottom: 10px;
}
h2 {
color: #764ba2;
font-size: 1.8em;
margin-top: 30px;
margin-bottom: 15px;
border-left: 4px solid #764ba2;
padding-left: 15px;
}
h3 {
color: #555;
font-size: 1.3em;
margin-top: 20px;
margin-bottom: 10px;
}
p {
margin-bottom: 15px;
}
ul,
ol {
margin-left: 30px;
margin-bottom: 15px;
}
li {
margin-bottom: 8px;
}
code {
background: #f4f4f4;
padding: 2px 6px;
border-radius: 3px;
font-family: 'Courier New', monospace;
font-size: 0.9em;
}
pre {
background: #2d2d2d;
color: #f8f8f2;
padding: 15px;
border-radius: 5px;
overflow-x: auto;
margin-bottom: 15px;
}
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 20px;
}
th,
td {
padding: 12px;
text-align: left;
border-bottom: 1px solid #ddd;
}
th {
background: #667eea;
color: white;
font-weight: 600;
}
tr:hover {
background: #f5f5f5;
}
.alert {
padding: 15px;
border-radius: 5px;
margin-bottom: 20px;
}
.alert-info {
background: #e3f2fd;
border-left: 4px solid #2196f3;
color: #1976d2;
}
.alert-warning {
background: #fff3e0;
border-left: 4px solid #ff9800;
color: #e65100;
}
.alert-success {
background: #e8f5e9;
border-left: 4px solid #4caf50;
color: #2e7d32;
}
.btn {
display: inline-block;
padding: 10px 20px;
background: #667eea;
color: white;
text-decoration: none;
border-radius: 5px;
margin: 5px;
}
.btn:hover {
background: #5568d3;
}
.toc {
background: #f9f9f9;
padding: 20px;
border-radius: 5px;
margin-bottom: 30px;
}
.toc a {
color: #667eea;
text-decoration: none;
}
.toc a:hover {
text-decoration: underline;
}
.contact-box {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 20px;
border-radius: 10px;
text-align: center;
margin-top: 30px;
}
.contact-box a {
color: white;
text-decoration: underline;
}
</style>
</head>
<body>
<div class="container">
<h1>📚 FxMathQuant User Manual</h1>
<p><strong>AI-Powered Trading Strategy Generator</strong></p>
<div class="toc">
<h3>📋 Table of Contents</h3>
<ol>
<li><a href="#getting-started">Getting Started</a></li>
<li><a href="#license">License Activation</a></li>
<li><a href="#export">Exporting Data from MT4/MT5</a></li>
<li><a href="#upload">Uploading Data</a></li>
<li><a href="#config">Configuring Strategy Generation</a></li>
<li><a href="#walkforward">Walk-Forward Analysis</a></li>
<li><a href="#montecarlo">Monte Carlo Simulation</a></li>
<li><a href="#generate">Generating Strategies</a></li>
<li><a href="#results">Viewing Results</a></li>
<li><a href="#download">Downloading Strategies</a></li>
<li><a href="#troubleshoot">Troubleshooting</a></li>
<li><a href="#support">Contact Support</a></li>
</ol>
</div>
<h2 id="getting-started">🚀 Getting Started</h2>
<h3>What is FxMathQuant?</h3>
<p>FxMathQuant is an AI-powered trading strategy generator that uses genetic algorithms to discover profitable
trading strategies from your historical price data.</p>
<h3>System Requirements</h3>
<ul>
<li><strong>Web Browser</strong>: Chrome, Firefox, Safari, or Edge (latest version)</li>
<li><strong>MetaTrader</strong>: MT4 or MT5 (for data export)</li>
<li><strong>License Key</strong>: Required for access</li>
</ul>
<h2 id="license">🔑 License Activation</h2>
<h3>Step 1: Obtain License Key</h3>
<p>Purchase a license from:</p>
<ul>
<li><strong>Email</strong>: <a href="mailto:fxmathsolution@gmail.com">fxmathsolution@gmail.com</a></li>
<li><strong>Telegram</strong>: <a href="https://t.me/FxMath" target="_blank">https://t.me/FxMath</a></li>
</ul>
<h3>Step 2: Activate License</h3>
<ol>
<li>Open the application at: <a href="https://web.fxmathquant.com/login.html"
target="_blank">https://web.fxmathquant.com/login.html</a></li>
<li>Enter your license key in the format: <code>XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX</code></li>
<li>Click "Activate License"</li>
<li>Wait for validation (requires internet connection)</li>
<li>You'll be redirected to the main application</li>
</ol>
<div class="alert alert-info">
<strong>Session Duration:</strong> Your session remains active until you logout or clear browser data. There
is no automatic logout.
</div>
<h2 id="export">📊 Exporting Data from MT4/MT5</h2>
<h3>Download Data Provider EA</h3>
<p>Download the EA from the application:</p>
<ul>
<li><strong>MT4</strong>: <code>FxMathQuant_DataExporter_MT4.ex4</code></li>
<li><strong>MT5</strong>: <code>FxMathQuant_DataExporter_MT5.ex5</code></li>
</ul>
<p>For detailed step-by-step instructions, see the <a href="ea-guide.html" target="_blank">EA Setup Guide</a>.
</p>
<h3>Export Historical Data</h3>
<ol>
<li>Open a chart (e.g., XAUUSD H1)</li>
<li>Drag the EA onto the chart</li>
<li>Configure settings:
<ul>
<li><strong>Bars to Export</strong>: 10,000 (recommended)</li>
<li><strong>Remove Suffix</strong>: true</li>
<li><strong>Export Folder</strong>: FxMathQuant</li>
</ul>
</li>
<li>Click "Export to CSV" button</li>
<li>Wait for completion message</li>
<li>Find your file: <code>MQL4/Files/FxMathQuant/XAUUSD_H1.csv</code></li>
</ol>
<h3>Recommended Data</h3>
<table>
<thead>
<tr>
<th>Timeframe</th>
<th>Bars</th>
<th>Use Case</th>
</tr>
</thead>
<tbody>
<tr>
<td>M15</td>
<td>10,000</td>
<td>Scalping strategies</td>
</tr>
<tr>
<td>H1</td>
<td>10,000</td>
<td>Intraday trading</td>
</tr>
<tr>
<td>H4</td>
<td>5,000</td>
<td>Swing trading</td>
</tr>
<tr>
<td>D1</td>
<td>3,000</td>
<td>Position trading</td>
</tr>
</tbody>
</table>
<h2 id="upload">📤 Uploading Data</h2>
<ol>
<li>Click "Browse" or drag-and-drop your CSV file</li>
<li>Select the file exported from MT4/MT5</li>
<li>Wait for parsing (10,000 bars ≈ 2-3 seconds)</li>
<li>Confirmation: "Data loaded successfully: X bars"</li>
</ol>
<h2 id="config">⚙️ Configuring Strategy Generation</h2>
<h3>Genetic Algorithm Settings</h3>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Default</th>
<th>Range</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Population Size</td>
<td>100</td>
<td>50-500</td>
<td>Number of strategies per generation</td>
</tr>
<tr>
<td>Generations</td>
<td>50</td>
<td>10-200</td>
<td>Number of evolution cycles</td>
</tr>
<tr>
<td>Mutation Rate</td>
<td>0.1</td>
<td>0.01-0.5</td>
<td>Probability of random changes</td>
</tr>
<tr>
<td>Crossover Rate</td>
<td>0.7</td>
<td>0.3-0.9</td>
<td>Probability of combining strategies</td>
</tr>
</tbody>
</table>
<h3 id="walkforward">🔬 Walk-Forward Analysis</h3>
<p>Walk-forward analysis validates strategies on out-of-sample data to detect overfitting and ensure real-world
performance.</p>
<div class="alert alert-info">
<strong>What is Overfitting?</strong> A strategy that performs well on historical data but fails in live
trading due to being too closely fitted to past price patterns.
</div>
<h4>How It Works</h4>
<ol>
<li><strong>Data Splitting:</strong> Historical data is divided into training and testing periods</li>
<li><strong>Training Period:</strong> Strategy is optimized on this data (e.g., 70% of bars)</li>
<li><strong>Testing Period:</strong> Strategy is validated on unseen data (e.g., 30% of bars)</li>
<li><strong>Performance Comparison:</strong> Metrics are compared between training and testing</li>
<li><strong>Robustness Score:</strong> A score (0-100) indicates how well the strategy generalizes</li>
</ol>
<h4>Configuration</h4>
<ul>
<li><strong>Enable Walk-Forward Validation:</strong> Check this box to activate the feature</li>
<li><strong>Training Period:</strong> Adjust the slider (50-90%, default: 70%)
<ul>
<li>Higher ratio = More data for training, less for validation</li>
<li>Lower ratio = Less training data, more for validation</li>
<li>Recommended: 70% for most cases</li>
</ul>
</li>
</ul>
<h4>Understanding the Badges</h4>
<p>Each strategy card displays a walk-forward badge showing its robustness:</p>
<table>
<thead>
<tr>
<th>Badge</th>
<th>Score Range</th>
<th>Meaning</th>
<th>Recommendation</th>
</tr>
</thead>
<tbody>
<tr>
<td>✓ ROBUST (Green)</td>
<td>60-100</td>
<td>Strategy passed validation</td>
<td>Safe to use for live trading</td>
</tr>
<tr>
<td>⚠ OVERFITTED (Orange)</td>
<td>0-59</td>
<td>Strategy failed validation</td>
<td>Avoid - likely curve-fitted</td>
</tr>
</tbody>
</table>
<h4>Robustness Score Interpretation</h4>
<ul>
<li><strong>80-100:</strong> Excellent - Minimal degradation, high confidence</li>
<li><strong>60-79:</strong> Good - Acceptable degradation, suitable for trading</li>
<li><strong>40-59:</strong> Moderate - Concerning degradation, needs review</li>
<li><strong>0-39:</strong> Poor - High overfitting risk, avoid</li>
</ul>
<h4>What Gets Measured</h4>
<p>The robustness score is calculated based on degradation in:</p>
<ul>
<li><strong>Profit Factor:</strong> How much profit factor drops in testing vs. training</li>
<li><strong>Win Rate:</strong> Percentage point decrease in win rate</li>
<li><strong>Max Drawdown:</strong> Increase in maximum drawdown</li>
<li><strong>Trade Count:</strong> Sufficient trades in testing period</li>
</ul>
<div class="alert alert-warning">
<strong>Important:</strong> A strategy with excellent training performance but poor testing performance is
likely overfitted and should be avoided.
</div>
<h4>Best Practices</h4>
<ul>
<li>Use at least 1,000 bars of data (minimum 300 for testing)</li>
<li>Keep training ratio at 70% for balanced results</li>
<li>Only trade strategies with robustness score ≥ 60</li>
<li>Prefer strategies with scores above 80 for higher confidence</li>
<li>If all strategies fail, try different data or settings</li>
</ul>
<h4>Impact on Strategy Generation</h4>
<p>When walk-forward is enabled:</p>
<ul>
<li><strong>Failed strategies:</strong> Receive 50% fitness penalty (less likely to be selected)</li>
<li><strong>Robust strategies:</strong> Receive up to 50% fitness bonus (prioritized)</li>
<li><strong>Result:</strong> GA naturally evolves toward robust, non-overfitted strategies</li>
</ul>
<h3 id="montecarlo">🎲 Monte Carlo Simulation</h3>
<p>Monte Carlo simulation is a powerful risk analysis tool that tests strategy robustness by randomly shuffling
the order of trades thousands of times.</p>
<div class="alert alert-info">
<strong>Why Use Monte Carlo?</strong> It reveals whether your strategy's performance is due to genuine edge
or just lucky trade sequencing. A robust strategy should show consistent positive returns across most
simulations.
</div>
<h4>How It Works</h4>
<ol>
<li><strong>Trade Extraction:</strong> All trades from the backtest are collected</li>
<li><strong>Random Shuffling:</strong> Trades are randomly reordered (Fisher-Yates algorithm)</li>
<li><strong>Equity Calculation:</strong> Account balance is recalculated for each shuffle</li>
<li><strong>Statistical Analysis:</strong> Results are analyzed across thousands of iterations</li>
<li><strong>Risk Assessment:</strong> Probability distributions and risk metrics are calculated</li>
</ol>
<h4>Configuration</h4>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Default</th>
<th>Range</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>Enable Monte Carlo</td>
<td>Off</td>
<td>On/Off</td>
<td>Activate Monte Carlo analysis</td>
</tr>
<tr>
<td>Iterations</td>
<td>1,000</td>
<td>100-10,000</td>
<td>Number of random shuffles</td>
</tr>
<tr>
<td>Risk of Ruin Threshold</td>
<td>20%</td>
<td>10-50%</td>
<td>Loss threshold for RoR calculation</td>
</tr>
</tbody>
</table>
<h4>Recommended Settings</h4>
<ul>
<li><strong>Quick Analysis:</strong> 1,000 iterations (1-2 seconds)</li>
<li><strong>Standard Analysis:</strong> 5,000 iterations (3-4 seconds)</li>
<li><strong>Thorough Analysis:</strong> 10,000 iterations (6-8 seconds)</li>
</ul>
<h4>Requirements</h4>
<ul>
<li>Minimum 20 trades for meaningful results</li>
<li>More trades = more accurate analysis</li>
<li>Enable before generating strategies</li>
</ul>
<h4>Understanding the Results</h4>
<p>When you click the "🎲 MC" button on a strategy card, a professional modal displays:</p>
<h5>Risk Assessment Banner</h5>
<table>
<thead>
<tr>
<th>Risk Level</th>
<th>RoR Range</th>
<th>Meaning</th>
<th>Recommendation</th>
</tr>
</thead>
<tbody>
<tr>
<td>✅ LOW RISK</td>
<td>&lt; 5%</td>
<td>Excellent robustness</td>
<td>Safe to trade</td>
</tr>
<tr>
<td>⚠️ MODERATE RISK</td>
<td>5-15%</td>
<td>Acceptable variability</td>
<td>Monitor closely</td>
</tr>
<tr>
<td>❌ HIGH RISK</td>
<td>&gt; 15%</td>
<td>High variance</td>
<td>Reduce position size</td>
</tr>
</tbody>
</table>
<h5>Key Metrics</h5>
<ul>
<li><strong>Expected Return:</strong> Average outcome across all simulations (more reliable than single
backtest)</li>
<li><strong>Risk of Ruin:</strong> Probability of losing threshold % of capital (lower is better)</li>
<li><strong>Standard Deviation:</strong> Measure of result variability (lower = more consistent)</li>
<li><strong>Percentiles:</strong> Distribution of outcomes (5th, 25th, 50th, 75th, 95th)</li>
<li><strong>Confidence Intervals:</strong> Range where 90% or 50% of outcomes fall</li>
</ul>
<h5>Equity Distribution Histogram</h5>
<p>The histogram shows the distribution of final equity with color-coded bars:</p>
<ul>
<li><strong style="color: #f56565;">Red bars:</strong> Worst 5% of outcomes (below 5th percentile)</li>
<li><strong style="color: #ed8936;">Orange bars:</strong> Below average (5th-25th percentile)</li>
<li><strong style="color: #48bb78;">Green bars:</strong> Typical range (25th-75th percentile)</li>
<li><strong style="color: #38b2ac;">Teal bars:</strong> Best outcomes (above 75th percentile)</li>
</ul>
<h5>What to Look For</h5>
<ul>
<li><strong>Normal distribution:</strong> Bell curve shape is ideal</li>
<li><strong>Narrow spread:</strong> Consistent results (safer)</li>
<li><strong>Positive 5th percentile:</strong> Even worst case is profitable</li>
<li><strong>Low RoR:</strong> Less than 10% is good, less than 5% is excellent</li>
</ul>
<div class="alert alert-warning">
<strong>Warning Signs:</strong> Very wide distribution, negative 25th percentile, high risk of ruin (&gt;
20%), or bimodal distribution (two peaks) indicate a risky strategy.
</div>
<h4>Best Practices</h4>
<h5>Before Trading:</h5>
<ul>
<li>Run Monte Carlo on all strategies</li>
<li>Only trade strategies with RoR &lt; 10%</li>
<li>Check 5th percentile is acceptable</li>
<li>Verify normal distribution shape</li>
</ul>
<h5>Position Sizing:</h5>
<ul>
<li><strong>Low Risk (&lt; 5% RoR):</strong> Standard position size</li>
<li><strong>Moderate Risk (5-15% RoR):</strong> Reduce position by 50%</li>
<li><strong>High Risk (&gt; 15% RoR):</strong> Avoid or use micro lots</li>
</ul>
<h5>Ongoing Monitoring:</h5>
<ul>
<li>Re-run Monte Carlo monthly with fresh data</li>
<li>Compare live results to MC predictions</li>
<li>Stop trading if results fall below 5th percentile</li>
<li>Adjust position size based on actual variance</li>
</ul>
<h2 id="generate">🎯 Generating Strategies</h2>
<ol>
<li>Review your settings</li>
<li>Click "Start Generation"</li>
<li>Monitor progress (current generation, strategies found, best fitness)</li>
<li>Wait for completion (30 seconds to 5 minutes)</li>
</ol>
<h2 id="results">📈 Viewing Results</h2>
<p>Each strategy shows:</p>
<ul>
<li><strong>Profit Factor</strong>: Ratio of gross profit to gross loss</li>
<li><strong>Win Rate</strong>: Percentage of winning trades</li>
<li><strong>Total Trades</strong>: Number of trades executed</li>
<li><strong>Net Profit</strong>: Total profit in currency</li>
<li><strong>Max Drawdown</strong>: Largest equity drop</li>
</ul>
<p>Click "View Details" to see:</p>
<ul>
<li>Performance Metrics</li>
<li>BUY/SELL Rules</li>
<li>Equity Curve Chart</li>
<li>Hourly Performance</li>
<li>Complete Trade Statement</li>
</ul>
<h2 id="download">💾 Downloading Strategies</h2>
<h3>Available Formats</h3>
<ul>
<li><strong>MetaTrader 4 (.mq4)</strong> - For MT4 platform</li>
<li><strong>MetaTrader 5 (.mq5)</strong> - For MT5 platform</li>
<li><strong>cTrader (.cs)</strong> - For cTrader platform</li>
<li><strong>TradingView (Pine Script)</strong> - For TradingView</li>
<li><strong>HTML Report</strong> - Comprehensive performance report</li>
<li><strong>JSON Data</strong> - Raw strategy data</li>
</ul>
<h2 id="troubleshoot">🐛 Troubleshooting</h2>
<h3>CSV Upload Issues</h3>
<div class="alert alert-warning">
<strong>Error:</strong> "CSV must contain: time, open, high, low, close columns"<br>
<strong>Solution:</strong> Ensure CSV has required columns. Column names can be lowercase or capitalized.
</div>
<h3>License Issues</h3>
<div class="alert alert-warning">
<strong>Error:</strong> "Invalid license key"<br>
<strong>Solution:</strong> Check key format (32 characters with dashes). Copy-paste from email.
</div>
<h3>Generation Issues</h3>
<div class="alert alert-warning">
<strong>No strategies found</strong><br>
<strong>Solution:</strong> Relax criteria (lower Min Profit Factor, Win Rate). Increase population size and
generations.
</div>
<h2 id="support">📞 Contact Support</h2>
<div class="contact-box">
<h3>Get Help</h3>
<p><strong>📧 Email:</strong> <a href="mailto:fxmathsolution@gmail.com">fxmathsolution@gmail.com</a></p>
<p><strong>💬 Telegram:</strong> <a href="https://t.me/FxMath" target="_blank">https://t.me/FxMath</a></p>
<p><strong>👥 Telegram Group:</strong> <a href="https://t.me/FxMathQuant"
target="_blank">https://t.me/FxMathQuant</a></p>
<p style="margin-top: 15px; font-size: 0.9em;">Response time: 24-48 hours via email, faster on Telegram</p>
</div>
<div class="alert alert-info" style="margin-top: 30px;">
<strong>⚠️ Disclaimer:</strong> Past performance does not guarantee future results. Always test strategies
on demo account first. Use proper risk management.
</div>
<p style="text-align: center; margin-top: 30px; color: #999; font-size: 0.9em;">
© 2025 FxMath Solution. All rights reserved.
</p>
</div>
</body>
</html>