Convert timezone from GMT+0 to Cambodia GMT+7

- Updated session input parameters with Cambodia timezone (GMT+7)
- Modified GetCurrentSession() function to use Cambodia time offset
- Adjusted session times to avoid midnight crossover complexity:
  * Asia Session: 07:00-16:00 Cambodia Time
  * London Session: 15:00-23:59 Cambodia Time
  * New York Session: 20:00-23:59 Cambodia Time
- Updated documentation (README.md, PRD.md) to reflect timezone changes
- Added debug logging for timezone verification
- Prepared for Phase 3 implementation with proper Cambodia timezone support
This commit is contained in:
rithsila
2025-09-26 10:02:26 +07:00
parent e80b78345e
commit e20b066d60
3 changed files with 62 additions and 34 deletions
+39 -18
View File
@@ -10,7 +10,7 @@
## 🚀 **Project Status**
- **✅ Phase 1 (Core Trading Logic)**: 100% Complete
- **✅ Phase 2 (Multi-Timeframe Integration)**: 100% Complete
- **✅ Phase 2 (Multi-Timeframe Integration)**: 100% Complete
- **📊 Overall Completion**: 95%
- **🎯 Production Status**: Ready for Live Trading
@@ -29,24 +29,28 @@
## ✨ **Features**
### 🎯 **Core Smart Money Concepts**
- **Order Blocks Detection**: Institutional supply/demand zones
- **Fair Value Gaps (FVG)**: Market inefficiency identification
- **Break of Structure (BOS)**: Trend change confirmation
- **Liquidity Sweeps**: Stop hunt detection and exploitation
### 📊 **Multi-Timeframe Analysis**
- **5 Timeframes**: M1, M15, H4, D1, W1 analysis
- **Bias Calculation**: Advanced strength scoring (0-100 scale)
- **Bias Change Detection**: Historical tracking with thresholds
- **Major Levels**: Key support/resistance identification
### 🛡️ **Professional Risk Management**
- **Position Sizing**: 1% risk per trade (configurable)
- **Risk-Reward**: 2:1 minimum ratio
- **Daily Limits**: Maximum 3 trades per symbol
- **Emergency Stops**: Comprehensive protection system
### 🔧 **Advanced Features**
- **Multi-Symbol Processing**: 8 major pairs simultaneously
- **Session Filtering**: Asia, London, New York sessions
- **Real-time Monitoring**: Comprehensive logging system
@@ -55,6 +59,7 @@
## 🔧 **Installation**
### **Prerequisites**
- MetaTrader 5 platform
- Windows 10/11 (recommended)
- Minimum 4GB RAM
@@ -63,18 +68,21 @@
### **Installation Steps**
1. **Clone the Repository**
```bash
git clone https://github.com/rithsila/MT5-EA-Sniper-Strategy.git
cd MT5-EA-Sniper-Strategy
```
2. **Copy EA to MT5**
```bash
# Copy to MT5 Experts folder
copy src\SniperEA.mq5 "C:\Users\%USERNAME%\AppData\Roaming\MetaQuotes\Terminal\[TERMINAL_ID]\MQL5\Experts\"
```
3. **Compile the EA**
```bash
# Using PowerShell build script
.\build.ps1
@@ -89,6 +97,7 @@
## 🚀 **Quick Start**
### **Basic Configuration**
```mql5
// Risk Management
RiskPercent = 1.0 // 1% risk per trade
@@ -102,11 +111,13 @@ EnableMajorLevelsFilter = true
```
### **Recommended Symbols**
- **Major Pairs**: EURUSD, GBPUSD, USDJPY, USDCHF
- **Commodity**: XAUUSD (Gold)
- **Cross Pairs**: AUDUSD, USDCAD, NZDUSD
### **Optimal Timeframes**
- **Primary**: M1 (for entries)
- **Analysis**: M15, H4, D1, W1 (for bias confirmation)
@@ -114,31 +125,33 @@ EnableMajorLevelsFilter = true
### **Input Parameters**
| Parameter | Default | Description |
|-----------|---------|-------------|
| `RiskPercent` | 1.0 | Risk percentage per trade |
| `MinRR` | 2.0 | Minimum risk-reward ratio |
| `MaxTradesPerDay` | 3 | Daily trade limit per symbol |
| `UseTimeFilter` | false | Enable session filtering |
| `MinBiasStrength` | 60.0 | Minimum bias strength for trading |
| `BiasHistoryPeriods` | 10 | Bias history tracking periods |
| `EnableBiasChangeDetection` | true | Enable bias change alerts |
| `EnableMajorLevelsFilter` | true | Filter trades by major levels |
| Parameter | Default | Description |
| --------------------------- | ------- | --------------------------------- |
| `RiskPercent` | 1.0 | Risk percentage per trade |
| `MinRR` | 2.0 | Minimum risk-reward ratio |
| `MaxTradesPerDay` | 3 | Daily trade limit per symbol |
| `UseTimeFilter` | false | Enable session filtering |
| `MinBiasStrength` | 60.0 | Minimum bias strength for trading |
| `BiasHistoryPeriods` | 10 | Bias history tracking periods |
| `EnableBiasChangeDetection` | true | Enable bias change alerts |
| `EnableMajorLevelsFilter` | true | Filter trades by major levels |
### **Session Settings**
```mql5
// Trading Sessions (GMT+0)
AsiaStart = "00:00" // Asia session start
AsiaEnd = "09:00" // Asia session end
LondonStart = "08:00" // London session start
LondonEnd = "17:00" // London session end
NewYorkStart = "13:00" // New York session start
NewYorkEnd = "22:00" // New York session end
// Trading Sessions (Cambodia Time GMT+7)
AsiaStart = "07:00" // Asia session start
AsiaEnd = "16:00" // Asia session end
LondonStart = "15:00" // London session start
LondonEnd = "23:59" // London session end
NewYorkStart = "20:00" // New York session start
NewYorkEnd = "23:59" // New York session end
```
## 📈 **Trading Strategy**
### **Entry Criteria**
1. **Liquidity Sweep**: Stop hunt confirmation
2. **Break of Structure**: Trend change validation
3. **Fair Value Gap**: Market inefficiency present
@@ -146,12 +159,14 @@ NewYorkEnd = "22:00" // New York session end
5. **Multi-Timeframe Bias**: HTF confirmation aligned
### **Trade Management**
- **Entry**: Market execution at optimal price
- **Stop Loss**: Beyond Order Block or sweep level
- **Take Profit**: 2:1 to 3:1 risk-reward ratio
- **Position Size**: 1% account risk per trade
### **Pattern Sequence**
```
Liquidity Sweep → Break of Structure → Fair Value Gap → Order Block → ENTRY
```
@@ -159,6 +174,7 @@ Liquidity Sweep → Break of Structure → Fair Value Gap → Order Block → EN
## 📊 **Performance**
### **Testing Results** (7-Day Backtest)
- **Pattern Detections**: 1,988,538 total patterns
- **Order Blocks**: 1,068,185 detected
- **Fair Value Gaps**: 920,353 detected
@@ -167,6 +183,7 @@ Liquidity Sweep → Break of Structure → Fair Value Gap → Order Block → EN
- **Memory Usage**: 1.3GB (multi-symbol processing)
### **Technical Metrics**
- **Compilation**: 0 errors, 0 warnings ✅
- **Code Quality**: Professional-grade architecture ✅
- **Error Handling**: Comprehensive validation ✅
@@ -175,16 +192,19 @@ Liquidity Sweep → Break of Structure → Fair Value Gap → Order Block → EN
## 📚 **Documentation**
### **Core Documentation**
- [Implementation Plan](implementplan.md) - Development roadmap and status
- [Product Requirements](docs/PRD.md) - Detailed specifications
- [Testing Guide](docs/TESTING_GUIDE.md) - Comprehensive testing procedures
### **Development Guides**
- [MT5 EA Development Workflow](docs/MT5_EA_DEVELOPMENT_WORKFLOW.md)
- [Pattern Validation Framework](docs/PATTERN_VALIDATION_FRAMEWORK.md)
- [Performance Regression Framework](docs/PERFORMANCE_REGRESSION_FRAMEWORK.md)
### **Build & Deployment**
- [Compilation Automation](docs/COMPILATION_AUTOMATION.md)
- [Feature Branch Methodology](docs/FEATURE_BRANCH_METHODOLOGY.md)
- [Quick Monitoring](docs/QUICK_MONITORING.md)
@@ -209,6 +229,7 @@ MT5-EA-Sniper-Strategy/
We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.
### **Development Setup**
1. Fork the repository
2. Create a feature branch
3. Make your changes
+9 -9
View File
@@ -39,19 +39,19 @@ Develop a sophisticated MT5 Expert Advisor that implements institutional trading
#### Asia Session
- **Time Range**: 00:00 - 09:00 GMT
- **Time Range**: 07:00 - 16:00 Cambodia Time (GMT+7)
- **Characteristics**: Range-bound, lower volatility
- **Strategy Focus**: Liquidity sweep reversals
#### London Session
- **Time Range**: 08:00 - 17:00 GMT
- **Time Range**: 15:00 - 23:59 Cambodia Time (GMT+7)
- **Characteristics**: High volatility, strong trends
- **Strategy Focus**: BOS continuation trades
#### New York Session
- **Time Range**: 13:00 - 22:00 GMT
- **Time Range**: 20:00 - 23:59 Cambodia Time (GMT+7)
- **Characteristics**: High volume, institutional activity
- **Strategy Focus**: Order block reactions
@@ -148,12 +148,12 @@ UseTimeFilter = true // Enable session filtering
#### Session Settings
```
AsiaStart = "00:00" // Asia session start
AsiaEnd = "09:00" // Asia session end
LondonStart = "08:00" // London session start
LondonEnd = "17:00" // London session end
NYStart = "13:00" // New York session start
NYEnd = "22:00" // New York session end
AsiaStart = "07:00" // Asia session start (Cambodia Time GMT+7)
AsiaEnd = "16:00" // Asia session end (Cambodia Time GMT+7)
LondonStart = "15:00" // London session start (Cambodia Time GMT+7)
LondonEnd = "23:59" // London session end (Cambodia Time GMT+7)
NYStart = "20:00" // New York session start (Cambodia Time GMT+7)
NYEnd = "23:59" // New York session end (Cambodia Time GMT+7)
```
#### Symbol Configuration
+14 -7
View File
@@ -23,12 +23,12 @@ input double RiskPercent = 1.0; // Risk perce
input double MinRR = 2.0; // Minimum risk-reward ratio
input bool UseTimeFilter = false; // Enable session filtering
input group "=== Session Settings ===" input string AsiaStart = "00:00"; // Asia session start (GMT)
input string AsiaEnd = "23:59"; // Asia session end (GMT)
input string LondonStart = "08:00"; // London session start (GMT)
input string LondonEnd = "17:00"; // London session end (GMT)
input string NYStart = "13:00"; // New York session start (GMT)
input string NYEnd = "22:00"; // New York session end (GMT)
input group "=== Session Settings ===" input string AsiaStart = "07:00"; // Asia session start (Cambodia Time GMT+7)
input string AsiaEnd = "16:00"; // Asia session end (Cambodia Time GMT+7)
input string LondonStart = "15:00"; // London session start (Cambodia Time GMT+7)
input string LondonEnd = "23:59"; // London session end (Cambodia Time GMT+7)
input string NYStart = "20:00"; // New York session start (Cambodia Time GMT+7)
input string NYEnd = "23:59"; // New York session end (Cambodia Time GMT+7)
input group "=== Risk Management ===" input int MaxSL = 50; // Maximum stop loss in pips
input int MinSL = 10; // Minimum stop loss in pips
@@ -441,12 +441,19 @@ void UpdateInfoPanel()
string GetCurrentSession()
{
MqlDateTime dt;
TimeToStruct(TimeGMT(), dt);
// Convert GMT to Cambodia Time (GMT+7) by adding 7 hours
TimeToStruct(TimeGMT() + 7 * 3600, dt);
int current_hour = dt.hour;
int current_minute = dt.min;
int current_time_minutes = current_hour * 60 + current_minute;
// Debug: Log current Cambodia time for verification
if (EnableDebugMode)
{
LogDebug(StringFormat("Current Cambodia Time: %02d:%02d", current_hour, current_minute));
}
// Convert session times to minutes
int asia_start = (int)(StringToTime("1970.01.01 " + AsiaStart) % 86400 / 60);
int asia_end = (int)(StringToTime("1970.01.01 " + AsiaEnd) % 86400 / 60);