The client's idea
Ramin Jafari works XAUUSD / EURUSD on M15; the opening brief was: When the price feed drops the bot should know what to do, not sit there confused.
Project and starting point
When the feed dropped the expert treated a stale candle as fresh and decided on invalid prices.
Solution architecture
Detection of duplicate candles and frozen prices, a conservative mode during long outages, every event logged, and an automatic return to normal.
During a long outage, doing nothing is safer than trading on suspect data. It matches how XAUUSD / EURUSD is actually traded and can be tested against the data already available.
Why this design
During a long outage, doing nothing is safer than trading on suspect data. It matches how XAUUSD / EURUSD is actually traded and can be tested against the data already available.
Implemented capabilities
Modules and components built: Conservative mode + event logging.
Delivered output:
Data feed failover plan — XAUUSD / EURUSD (M15)
Specification document and the rule-to-code mapping table
Full MQL5 source, commented
Test report: Simulated outage in three sessions
Parameter document and install guide (5 weeks)
Safeguards and risk control
Every first run happens on a demo account, and the pre-live checklist is filled in before the live connection.
Backtest and forward test method
Test method: Simulated outage in three sessions.
Testing runs in three stages: a backtest on historical data, limited optimisation inside the contract's scope, and a forward run with the parameters frozen.
Tools and stack: MQL5, a connection-loss simulator, event logs.
Every figure from this project is published together with its measurement conditions: the data window, the tick model, the spread, the commission and the build of the executable. Without them a number cannot be compared with anything.
Publishable results
Across three deliberate outage tests the expert placed no trade on invalid data, and every event appeared in the report.
Limitations and cautions
Every first run happens on a demo account, and the pre-live checklist is filled in before the live connection.
Every test result depends on the quality of the historical data, the broker's spread and market conditions, and none of it is a promise about the future. Through a severe price gap or a broker disconnection a stop loss cannot be guaranteed, so behaviour in those conditions must be reviewed separately.
Our next-step proposal
The next step is a quarterly settings review and keeping the documentation current with broker changes.
Portfolio
Measured results
These are the figures the test produced — not a promise about future performance.
- 12 s Order round-trip time
- 99.9 % Runtime stability in test
- 11 scenarios Scenario test coverage
- 1 min Recovery after drawdown