Zenith-FX/STRATEGY_TESTER_GUIDE.md
copilot-swe-agent[bot] 4ee0bb27e8 Add .ini files for MT5 Strategy Tester with multi-pair/timeframe support
Co-authored-by: simonokwundue-ops <243668919+simonokwundue-ops@users.noreply.github.com>
2025-11-14 04:48:30 +00:00

385 lines
11 KiB
Markdown

# Strategy Tester .ini Files Guide
## Overview
This repository now includes `.ini` configuration files for each EA variant to facilitate comprehensive testing in the MetaTrader 5 Strategy Tester. These files enable:
- **Multi-pair testing**: Test the EA across multiple currency pairs simultaneously
- **Multi-timeframe testing**: Evaluate performance across different timeframes
- **Optimization setup**: Pre-configured optimization parameters for each EA
- **Consistent testing**: Standardized test configurations for reproducible results
## Available .ini Files
| File | EA Version | Description |
|------|------------|-------------|
| `ForexTrader_EA_Base_Version.ini` | Base Version | Original EA with basic MA strategy |
| `ForexTrader_v1.2_Tuned_By_User.ini` | v1.2 | User-tuned improvements |
| `ForexTrader_v2_MultiStrategy.ini` | v2 | Multi-strategy implementation |
| `ForexTrader_v3_Production.ini` | v3 Production | **Recommended** - Production-ready single-pair |
| `ForexTrader_v3_MultiStrategy_Production.ini` | v3 Multi | **Recommended** - Production-ready multi-strategy |
## How to Use .ini Files in MT5 Strategy Tester
### Method 1: Quick Testing (Single Symbol)
1. **Open Strategy Tester** (Ctrl+R in MT5)
2. **Select Expert Advisor** from the dropdown
3. **Choose Symbol** (e.g., EURUSD)
4. **Select Timeframe** (e.g., M30 or H1)
5. **Set Test Period** (From date and To date)
6. **Load Settings**:
- Click "Expert Properties" button
- In the "Inputs" tab, click "Load"
- Navigate to the `.set` file in the Config folder (e.g., `ForexTrader_v3_Conservative.set`)
7. **Start Test** - Click "Start"
### Method 2: Multi-Symbol Testing (Using .ini Files)
Unfortunately, MT5's Strategy Tester does **not directly load .ini files**. The .ini files in this repository serve as:
1. **Reference configurations** - Showing recommended test setups
2. **Optimization templates** - Defining parameter ranges for optimization
3. **Multi-pair testing guides** - Listing which symbols to test
To test multiple symbols, you need to:
#### Option A: Manual Multi-Symbol Testing
1. Run the tester for each symbol individually
2. Use the same settings (.set file) for each symbol
3. Compare results across all tests
4. Track results in a spreadsheet
#### Option B: Automated Multi-Symbol Testing (Advanced)
1. Use MT5's built-in "Optimization" feature
2. Set up custom scripts to iterate through symbols
3. Use the MT5 API to automate testing
### Method 3: Optimization Testing
1. **Open Strategy Tester** (Ctrl+R)
2. **Select Expert Advisor**
3. **Choose Symbol and Timeframe**
4. **Enable Optimization**:
- Check "Optimization" checkbox
- Select "Slow complete algorithm" or "Fast genetic algorithm"
5. **Configure Parameters**:
- Click "Expert Properties"
- In the "Inputs" tab, enable checkboxes next to parameters you want to optimize
- Set Start, Stop, and Step values (refer to the .ini file for recommended ranges)
6. **Set Optimization Criteria**:
- Choose "Balance", "Profit Factor", "Sharpe Ratio", etc.
7. **Start Optimization**
8. **Review Results**:
- Check the "Optimization Results" tab
- Sort by your chosen criteria
- Select best parameter combinations
## .ini File Structure Explained
Each .ini file contains these sections:
### [Tester]
- **Model**: Testing model (0=Every tick, 1=1 min OHLC, 2=Open prices)
- **FromDate/ToDate**: Testing period
- **ForwardMode/ForwardDate**: Forward testing configuration
- **Deposit**: Initial balance
- **Leverage**: Account leverage
### [Symbols]
- **Symbol1-N**: List of symbols to test
- Example: EURUSD, GBPUSD, USDJPY, etc.
### [Timeframes]
- **Period1-N**: List of timeframes to test
- Values: 1=M1, 5=M5, 15=M15, 30=M30, 60=H1, 240=H4, 1440=D1
### [Parameters]
- All EA input parameters with default values
- Use these as reference when setting up tests
### [Optimization]
- Parameter ranges for optimization
- Format: `ParamName_Start`, `ParamName_Stop`, `ParamName_Step`
### [Genetic]
- Genetic algorithm settings for optimization
- Generations and Population size
## Recommended Testing Workflow
### Step 1: Initial Single-Pair Testing
```
EA: ForexTrader_v3_Production.mq5
Symbol: EURUSD
Timeframe: M30
Period: 6 months
Settings: Config/ForexTrader_v3_Conservative.set
Model: Every tick
```
### Step 2: Multi-Pair Validation
Test the same settings on different pairs:
- GBPUSD
- USDJPY
- AUDUSD
- USDCHF
Document which pairs perform best with your settings.
### Step 3: Timeframe Optimization
For the best-performing pairs, test across timeframes:
- M15
- M30
- H1
- H4
Identify optimal timeframe for each pair.
### Step 4: Parameter Optimization
Use the optimization ranges from the .ini files:
1. Start with conservative ranges
2. Optimize one parameter category at a time:
- MA periods
- Risk parameters (SL/TP)
- Filter thresholds (ADX, ATR)
3. Use forward testing to validate
### Step 5: Forward Testing
- Use the "Forward Mode" settings from .ini files
- Split your test period: 70% backtest, 30% forward test
- Ensure forward test results are consistent with backtest
### Step 6: Demo Testing
Before live trading:
1. Run optimized settings on demo account for minimum 1 month
2. Monitor performance daily
3. Adjust if necessary
## Symbol Lists in .ini Files
### Major Pairs (Best liquidity and spreads)
- EURUSD
- GBPUSD
- USDJPY
- AUDUSD
- USDCHF
- NZDUSD
- USDCAD
### Cross Pairs (Higher spreads but good opportunities)
- EURJPY
- GBPJPY
- EURGBP
- AUDJPY
- CHFJPY
## Timeframe Recommendations by EA Version
### Base Version & v1.2
- **Best**: M30, H1
- **Moderate**: M15, H4
- **Not Recommended**: M1, M5 (too noisy)
### v2 MultiStrategy
- **Best**: M15, M30 (multiple strategies benefit from more signals)
- **Moderate**: H1
- **Experimental**: H4
### v3 Production
- **Best**: M30, H1 (optimal balance)
- **Moderate**: M15, H4
- **Conservative**: H4, D1
### v3 MultiStrategy Production
- **Best**: M15, M30 (multi-timeframe analysis built-in)
- **Moderate**: H1
- **Advanced**: Simultaneous M15+M30+H1
## Performance Targets by Test Type
### Backtesting Targets
- **Win Rate**: >50%
- **Profit Factor**: >1.3
- **Sharpe Ratio**: >0.5
- **Max Drawdown**: <30%
- **Recovery Factor**: >2.0
### Forward Testing Targets
- **Results should match backtest within**: ±20%
- **Max Drawdown**: Should not exceed backtest max
- **Win Rate**: Should be within ±10% of backtest
## Optimization Best Practices
### Do's
✅ Optimize one parameter group at a time
✅ Use conservative parameter ranges
✅ Validate with forward testing
✅ Test on multiple symbols
✅ Use "Every tick" model for accuracy
✅ Allow sufficient test period (6+ months)
### Don'ts
❌ Don't over-optimize (curve fitting)
❌ Don't use too many parameters at once
❌ Don't ignore forward test results
❌ Don't optimize on short periods (<3 months)
❌ Don't skip demo testing after optimization
## Common Issues and Solutions
### Issue: EA Not Opening Positions in Tester
**Possible Causes:**
- ADX filter too strict (increase ADX_Minimum)
- Spread filter too strict (increase MaxSpreadPips)
- ATR filter blocking trades (adjust ATR range)
- Cooldown period too long
**Solution:**
1. Check the Journal tab for filter messages
2. Adjust filter parameters gradually
3. Verify symbol data quality
### Issue: Too Many Losses in Testing
**Possible Causes:**
- SL too tight for the timeframe
- Market conditions don't suit strategy
- Spread too high for short-term trades
**Solution:**
1. Increase StopLossPips
2. Enable UseDynamicSLTP for ATR-based SL
3. Test on different time periods
4. Try different symbols
### Issue: Optimization Takes Too Long
**Possible Causes:**
- Too many parameters selected
- Test period too long
- "Slow complete" algorithm selected
**Solution:**
1. Use "Fast genetic algorithm"
2. Reduce test period to 3-6 months
3. Optimize fewer parameters at once
4. Use "Open prices only" model for initial screening
## Testing Checklist
Before considering EA ready for demo/live:
- [ ] Backtested for minimum 6 months
- [ ] Forward tested for minimum 3 months
- [ ] Tested on minimum 3 major pairs
- [ ] Tested on recommended timeframes
- [ ] Win rate >50% achieved
- [ ] Profit factor >1.3 achieved
- [ ] Max drawdown <30%
- [ ] Optimization completed and validated
- [ ] Demo tested for minimum 1 month
- [ ] All parameters documented
- [ ] Risk per trade configured (1-2%)
- [ ] Max drawdown limit set
## Advanced: Creating Custom Test Suites
You can modify the .ini files to create custom test configurations:
1. **Copy an existing .ini file**
2. **Modify the [Symbols] section** to test specific pairs
3. **Adjust [Timeframes]** for your preferred trading style
4. **Update [Parameters]** with your custom settings
5. **Modify [Optimization] ranges** based on your findings
6. **Save with a descriptive name** (e.g., `ForexTrader_v3_MySetup.ini`)
## Support Resources
- **Full EA Documentation**: README_v3.md
- **Quick Start Guide**: QUICKSTART_v3.md
- **Implementation Details**: IMPLEMENTATION_V3.md
- **Preset Configurations**: Config/ folder (.set files)
## Notes
1. **Production EAs (v3.0) are recommended** for all serious testing and live trading
2. **Legacy versions (Base, v1.2, v2) have known flaws** - use for reference only
3. **Always test on demo** before live trading
4. **Start with conservative settings** and gradually optimize
5. **Monitor drawdown carefully** during all testing phases
## Version-Specific Testing Notes
### ForexTrader_EA Base Version
⚠️ **Not Recommended for Live Trading**
- Has critical flaws (10x SL/TP error)
- Use only for educational/comparison purposes
- Test with small amounts if testing at all
### ForexTrader_v1.2 Tuned By User
⚠️ **Not Recommended for Live Trading**
- Still has underlying flaws from base version
- User tuning improved some aspects but core issues remain
### ForexTrader_v2 MultiStrategy
⚠️ **Not Recommended for Live Trading**
- Multi-strategy concept good but implementation flawed
- Same core issues as earlier versions
### ForexTrader_v3_Production
**Production Ready**
- All critical flaws fixed
- Comprehensive testing recommended
- Start with Conservative settings
- Best for beginners to intermediate traders
### ForexTrader_v3_MultiStrategy_Production
**Production Ready**
- Advanced multi-strategy with all fixes
- More complex but higher potential
- Requires understanding of multiple strategies
- Best for experienced traders
---
## Quick Reference: Testing Commands
### Load .set File in Tester
```
1. Strategy Tester → Expert Properties → Inputs → Load
2. Navigate to: Config/ForexTrader_v3_Conservative.set
3. Click Open
```
### Run Single Symbol Test
```
1. Select EA
2. Choose Symbol (e.g., EURUSD)
3. Set Period (2023.01.01 - 2024.01.01)
4. Select Timeframe (M30)
5. Load Settings (.set file)
6. Model: Every tick
7. Start
```
### Run Optimization
```
1. Select EA and Symbol
2. Check "Optimization"
3. Expert Properties → Enable parameters to optimize
4. Set ranges (refer to .ini file)
5. Choose algorithm (Fast genetic)
6. Set criteria (Balance or Profit Factor)
7. Start
```
---
**Ready to test?** Start with `ForexTrader_v3_Production.ini` and the Conservative .set file!
For questions or issues, please open a GitHub issue with:
- EA version
- Symbol and timeframe tested
- Test period
- Settings used
- Results or errors encountered