CodeX Protex
- エキスパート
-
Zsolt Hevesi
MQL5 / MT5 Expert Advisor Developer | EA Fixes, XAUUSD, Backtesting & Optimization
I help traders and EA owners develop, fix, modify and test MetaTrader 5 Expert Advisors. - バージョン: 1.2
- アクティベーション: 5
CodeX Protex is an automated Expert Advisor for MetaTrader 5, primarily designed for XAUUSD (Gold) trading on the H1 timeframe.
The system analyses market structure, identifies relevant swing highs and lows, and uses pending breakout orders to participate in potential directional price movements.
The strategy focuses on price-structure detection and disciplined order management, rather than martingale-style position-size escalation.
How CodeX Protex Works
1. Price Structure Analysis
CodeX Protex continuously evaluates historical price action to identify significant support and resistance levels.
Its detection engine considers several factors:
-
Swing-high and swing-low patterns.
-
Pivot confirmation windows.
-
Minimum price displacement.
-
Distance between nearby trading levels.
-
Whether a support or resistance level has already been broken.
-
The age and maximum number of active levels.
These conditions help filter market structures before potential trading orders are created.
2. Breakout-Based Order Execution
When valid resistance or support levels are identified, the EA can place Buy Stop or Sell Stop pending orders.
Each pending order is evaluated against the configured trading conditions, including spread restrictions, price geometry, order expiration and exposure controls.
Orders may be removed when the associated trading level becomes invalid or the configured expiration period is reached.
3. Position Management
After an entry is executed, CodeX Protex can manage the position using:
-
Stop-loss protection.
-
Take-profit targets.
-
Trailing-stop adjustments.
-
Broker-specific execution constraints.
-
Configurable trading-session restrictions.
The strategy can maintain several pending orders and open positions simultaneously.
Main Features
Market Structure and Trading Logic
-
Automated swing-high and swing-low detection.
-
Breakout trading using Buy Stop and Sell Stop orders.
-
Configurable pivot sensitivity and level spacing.
-
Optional closed-bar signal confirmation.
-
Adaptive price-distance calculations introduced in version 1.02.
-
Detection of broken or invalidated trading levels.
Order and Risk Management
-
Fixed-lot trading with broker volume normalization.
-
Configurable stop-loss and take-profit distances.
-
Trailing-stop management.
-
Spread and execution-deviation filters.
-
Pending-order expiration.
-
Optional directional exposure limits.
-
Automatic removal of stale pending orders.
-
Broker stop-level and freeze-level checks.
-
Internal order-request safeguards.
Trading Session Protection
-
Friday trading restrictions.
-
Optional Friday position closure.
-
Configurable Monday trading resumption.
-
Optional daily rollover protection.
-
Pending-order management during restricted trading periods.
These controls support trading management but cannot guarantee a maximum drawdown or eliminate execution risk.
Recommended Configuration
Platform: MetaTrader 5
Primary instrument: XAUUSD (Gold)
Preferred timeframe: H1
Reference lot size: 0.01 fixed lot
Recommended deployment: Continuously running MT5 terminal or VPS
Reference starting capital: $1,000 in the historical test below
The Expert Advisor includes default configuration values and does not require an external SET file for its reference setup.
Selected Default Parameters
| Parameter | Default |
|---|---|
| Pivot Left Window | 36 bars |
| Pivot Right Window | 1 bar |
| Maximum Lookback | 321 bars |
| Maximum Active Levels | 5 per side |
| Minimum Price Displacement | 9.50 reference price units |
| Level Spacing | 4.375 reference price units |
| Fixed Lot | 0.01 |
| Stop Loss | 75 broker points |
| Take Profit | 375 broker points |
| Trailing Start | 50 broker points |
| Trailing Step | 25 broker points |
| Pending Order Expiration | 12 hours |
The value of a broker point depends on the symbol quotation format and contract specifications. Users should verify the resulting price distances before trading.
The default directional exposure setting does not impose an additional user-defined directional cap. Several positions may be opened when multiple valid breakout levels are triggered.
The optional closed-bar confirmation mode changes how swing structures are evaluated. Switching this setting can materially change results and requires separate testing.
What's New in Version 1.02?
CodeX Protex v1.02 introduces improved price-distance normalization for instruments with different nominal price ranges.
The detection engine also adjusts part of its pivot structure calculation when operating on higher chart timeframes.
These changes improve the EA's ability to process different market environments. However, XAUUSD H1 remains the primary reference configuration, and profitability on other symbols or timeframes is not established by the Gold backtest.
Verified Historical Backtest – Eightcap 2026
The following historical test was performed using CodeX Protex v1.02 on MetaTrader 5.
Test Environment
-
Broker: Eightcap Global Limited
-
Server: EightcapGlobal-Live
-
Instrument: XAUUSD
-
Timeframe: H1
-
Testing period: January 2 – October 8, 2026
-
Starting deposit: $1,000
-
Account leverage: 1:500
-
Modelling: Every tick based on real ticks
-
Reported history quality: 100% real ticks
-
Execution delay: 250 milliseconds
-
Trading volume: Fixed 0.01 lot
Historical Results
| Performance Metric | Result |
|---|---|
| Initial Deposit | $1,000.00 |
| Final Balance | $1,177.10 |
| Total Net Profit | +$177.10 |
| Historical Return | +17.71% |
| Maximum Equity Drawdown | 1.58% ($16.93) |
| Maximum Balance Drawdown | 1.55% ($16.65) |
| Profit Factor | 1.91 |
| Total Trades | 377 |
| Winning Trades | 219 (58.09%) |
| Maximum Consecutive Losses | 6 |
| Opening Lot Size | 0.01 |
| Maximum Concurrent Positions | 3 |
The test processed approximately 32.7 million historical ticks.
We independently examined the raw Strategy Tester log for data consistency. No tick-price mismatch, discarded-real-tick or invalid-stop warnings were found in this test.
The log did record several rejected pending-order attempts outside market trading hours. These events relate to trading-session execution restrictions rather than missing historical price data.
The accompanying 2026 backtest screenshot was created from the actual sequence of 377 closed trades. It displays the historical account balance curve, not an illustrative or estimated equity curve.
These results are historical simulations, not live trading performance.
The test covers 2026 through October 8 only and should not be interpreted as a full-year performance record.
Live Trading Monitoring
A separate real-account CodeX Protex trading signal is available through MQL5 Signals:
https://www.mql5.com/en/signals/2393148
The live signal and historical backtest represent different sources of evidence.
The monitored account may use a different EA version, parameter configuration or broker environment from the v1.02 reference test.
We recommend reviewing the live signal's actual trading history, account age, drawdown and execution characteristics independently from the historical test.
Before Trading with CodeX Protex
For new users, we recommend the following process:
-
Install CodeX Protex in MetaTrader 5 and attach it to an XAUUSD H1 chart.
-
Verify that automated trading and pending stop orders are enabled.
-
Check the broker's minimum trading volume, contract size, spreads, stop distances and margin requirements.
-
Run an independent Strategy Tester simulation using the broker's historical tick data.
-
Observe the EA on a demo account before considering live trading.
-
Verify Friday protection and server-time settings.
-
Monitor aggregate exposure when multiple pending orders or positions are present.
-
Review the terminal journal for rejected orders and trading-session restrictions.
Important Risk Disclosure
CodeX Protex is automated trading software, not a guaranteed-profit investment product or personalized investment recommendation.
Trading Gold, Forex and CFDs carries substantial financial risk. Market conditions can change, and historical performance does not predict future profitability.
Even when the strategy uses stop-loss orders and other protective settings, unexpected volatility, price gaps, liquidity restrictions, slippage or connectivity issues may produce losses larger than anticipated.
A low historical drawdown does not establish a maximum possible future loss.
Always use appropriate position sizing and conduct independent testing before trading with real funds.

