Volatility_HFT_EA
This EA uses two Simple Moving Averages (SMA 5 and SMA 25) to generate buy signals based on the deviation between the short-period MA and close price, combined with an upward MA slope condition. It operates on new bar events, executes market buy orders with fixed stop loss and MA-based take profit, and trades at minimum volume. The sell logic is entirely commented out, making it a buy-only scalping system.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
| Symbol | P&L | Annual | Max DD | Trades | Win rate | Sharpe | Recovery | Losing streak | Per trade | Status |
|---|---|---|---|---|---|---|---|---|---|---|
| EURUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| GBPUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| USDJPY | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
| XAUUSD | 0.00% | 0.00% | 0.00% | 0 | — | — | — | — | — | Not convertible yet |
Why this EA never traded: no entry rule survived the conversion.
Converted from MQL5 to Python and run with the same rules for every EA. Positions use MT5 lot sizes (100,000 units per FX lot, 100 oz per gold lot) with 1:100 leverage, one order at a time, and a stop-out below 10% of the starting balance. Sharpe is computed from the equity curve. Results marked as unreliable are shown for completeness only.
Blow-up risk: No blow-up pattern found
None of the usual blow-up patterns were found in the code, and the account was not stopped out in our backtests. That is not a guarantee: any EA can lose money.
High: stopped out in our backtest, or martingale/grid sizing without a stop loss. Elevated: martingale or grid sizing with a stop loss, or several positions at once without a stop loss. What the label means and what we found →
Strategy analysis
The strategy concept uses the deviation between a short-period SMA (period 5) and the close price as a volatility signal, triggering a buy when the deviation exceeds a threshold (-0.0015) and the MA is sloping upward. Entry conditions require val[0] (MA5 minus close) to be less than -0.0015, and MA_Val1[0] greater than MA_Val1[2], indicating the price is below the moving average while the MA is rising — a mean-reversion-within-trend approach. Exit conditions rely on a fixed stop loss of 15 points (auto-adjusted for 5/3-digit brokers) and the current MA5 value as take profit. Position sizing uses the broker's minimum lot size with no scaling or accumulation logic. Money management has a critical flaw: the margin variable is declared but never initialized before comparison with free_margin, making the margin check effectively useless since an uninitialized double could be anything. The sell logic is entirely commented out, leaving the EA as buy-only, making the strategy incomplete and asymmetric.
Strengths
- Uses new bar detection to prevent repeated trades on the same bar, which is logically sound
- Includes data synchronization checks and retry mechanism for historical data loading
- Stop loss and take profit are configurable with auto-adjustment for 5/3-digit brokers
- Checks for existing positions before opening new ones, preventing duplicate entries
Weaknesses
- Sell logic is entirely commented out, making the EA buy-only and the strategy severely incomplete
- The margin variable is never initialized before comparison, rendering the money management check useless
- EA_Magic parameter is not used in buy orders (hardcoded as 15489), parameter does not match actual behavior
- TakeProfit parameter is unused in buy orders (TP set to MA value instead), parameter name is misleading
- The deviation threshold -0.0015 is hardcoded and not adaptive to different instruments or price levels
- Only checks for a single position per symbol, does not support scenarios with multiple concurrent orders
Possible improvements
- Fix the margin variable initialization — use OrderCalcMargin() to properly calculate required margin before comparison with free margin
- Restore the sell logic and use the EA_Magic parameter consistently, making the strategy complete and parameters coherent
- Make the deviation threshold a configurable input parameter or dynamically calculate it based on ATR to adapt to different instruments
Risk assessment
Overall risk: Caution
- Uninitialized margin variable bypasses the margin check, potentially placing orders when insufficient funds exist
- Hardcoded MA-based take profit may be too close to entry price, causing frequent micro-profit exits
- Buy-only strategy cannot profit in downtrends, creating directional risk exposure
- ORDER_FILLING_FOK fill mode may be rejected by some brokers
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
StopLoss | 15 | Stop loss in points |
TakeProfit | 15 | Take profit in points (unused; buy TP follows MA value) |
EA_Magic | 12345 | EA magic number (buy orders hardcoded to 15489) |
Similar Scalping EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.