Skip to content

Latest commit

 

History

History
65 lines (53 loc) · 6.1 KB

File metadata and controls

65 lines (53 loc) · 6.1 KB

Bot Review & MShokryPro Notes

1. What the existing bots actually do

Bot Strategy Verdict
Mansour / MansourV2 / MansourTest / EA / EAa ADX +DI/-DI cross on H4 + H1, "Buy/Sell Double" Signal plus a martingale hedge. It opens DoubleFactor × net exposure against losing positions
EACandel (+ copies) Same ADX core on M1/M30, price "squares" grid, $2 basket TP Grid + hedge, StopLoss = 0, M1 signals are mostly noise
EAStoc / stoc D1 + H4 Stochastic cross Best idea in the folder, but it still uses the double/hedge exits
amro / AmroEA Daily Fibonacci levels, buy/sell on touch Grid with a TP at the next level and no SL
hedge.mq4 Decompiled third-party "SoloFx" 3× martingale, 0.01 → 196.83 lots over 10 levels. One trend day wipes the account. Don't run it (licensing issue too)

Main problem: almost every bot has no stop loss and adds size against losing trades. These systems show a smooth equity curve right up to the day the account is margin-called. Backtests tend to hide this.

2. Bugs found (in helpers.mq4 / EACandel / Mansour family)

  1. Close loops go forward (for(i=0;i<OrdersTotal();i++) + OrderClose). Closing shifts the indices, so every second order is skipped and _Close_all() leaves positions open. Loop backwards.
  2. The spread filter removes protection. When spread > Max_Spread, _Update(OP_BUY,true) removes SL and TP from every order. That happens during news, when you need stops most.
  3. Mixed units in _Update: (OrderOpenPrice()-Ask) >= TakeProfit compares a price difference (0.0012) with points (60), so it's never true. (Bid+OrderOpenPrice()) >= TakeProfit is also meaningless.
  4. Break-even math assumes $1 per point per lot (RealPoint * profit / lots). It's wrong for JPY pairs, gold, indices, and non-USD accounts. Use MODE_TICKVALUE/MODE_TICKSIZE.
  5. RealPipPoint() returns a point, not a pip. It's also wrong for 2-digit symbols. TakeProfit=60 = 6 pips on a 5-digit broker.
  6. Lots are normalized with Digits (price digits) instead of lot step. There's no min/max lot or margin check before OrderSend.
  7. EACandel copy.mq4: intersect_H1_* is overwritten with H4 values (copy-paste), BarH4 uses PERIOD_H2, and BarD is never set. order_check2()/Ordering() are never called, so the stochastic logic is dead code. max_q/min_q are bool but get assigned times.
  8. EAStoc: _Buys >= LotSize compares an order count with a lot size.
  9. stoc.mq4 reads stochastic at shift 0, which repaints (signals appear and disappear within the bar).
  10. hedge.mq4 f0_7(): operator precedence means it sums every SELL order on the account, from any symbol or EA.
  11. All EAs share MagicNumber = 224455. Two EAs on the same symbol manage each other's orders.
  12. No retries on requote/busy, and OrderSend errors are logged but never recovered from.
  13. FileOpen(FILE_READ|FILE_WRITE) without FileSeek(...,SEEK_END) overwrites the old log from the start.
  14. SendNotification fires on every bar, which spams your phone.

3. New bot: MShokryPro.mq4

A trend-following pullback system. It trades only in the direction of the higher timeframe:

  • Trend (H4): close vs EMA200 + EMA slope + DI direction.
  • Strength (H1): ADX ≥ 20. It skips chop, which is where your DI-cross bots lost most.
  • Entry (H1, closed bar): Stochastic 8-3-3 crosses up out of oversold in an uptrend (mirror for shorts). This keeps your Stochastic idea but only uses it with the trend. DI_CROSS mode keeps your ADX idea.
  • Exits: SL 1.5×ATR, TP 3×ATR (1:2), break-even at 1×ATR, ATR trailing stop, close on trend flip.
  • Risk: 1% of balance per trade (sized by tick value, so it works on any symbol). It skips the trade if min lot would over-risk. 3% daily loss pause, 15% max-DD kill-switch that survives terminal restarts.
  • Hygiene: reverse close loops, 3× retries on requote/busy, stop-level checks, ECN mode, a unique magic per symbol, and a chart panel.

4. How to test it (do this before any live money)

  1. Data: download M1 history for the pair (Tools → History Center, or Tick Data Suite for real-tick quality). Test on EURUSD, GBPUSD, USDJPY, XAUUSD, H1 chart.
  2. Tester: "Every tick" model, real spread (not "current"), 2015–2022 = in-sample.
  3. Judge on: profit factor > 1.3, max DD < 20%, ≥ 150 trades, and a smooth curve without martingale. Ignore net profit alone.
  4. Optimize little: only SL_ATR (1–2.5), TP_ATR (2–4), ADXMin (15–30), EntryMode. Pick a plateau of good results, not the single best peak.
  5. Out-of-sample: run the chosen settings unchanged on 2023–2026. If PF drops below ~1.1, the edge isn't real.
  6. Demo forward test: 2–3 months, then live at 0.25–0.5% risk.

5. Recommendations

  1. Retire the martingale/double logic (Mansour*, EACandel, hedge.mq4). If you want to keep a recovery feature, cap it at 2 additions with a hard basket stop in money.
  2. Always trade with a stop loss. Hedging a loser is still a loss, and you also pay swap and spread on both legs.
  3. Size by risk %, not fixed lots. 0.5–1% per trade and ≤ 3 correlated positions (EURUSD + GBPUSD long is roughly one trade).
  4. Stay on H1/H4. On M1/M5, spread and commission eat most retail edges.
  5. Add a news filter (avoid ±30 min around high-impact events), for example via a calendar CSV or a news indicator.
  6. Put the code under version control properly. Delete the copy/copy 2 files, keep one helpers.mqh as an include (.mqh, not .mq4), and commit each strategy change with its backtest report.
  7. Journal every change against a backtest report (save the tester HTML). The existing logs don't tell you why a version was better.
  8. Consider MQL5/MT5 for new work. It has multi-currency testing, real ticks, and faster optimization. The logic ports directly.
  9. Possible next strategies to build on the same risk framework:
    • Donchian 20/55 breakout (Turtle-style) on H4/D1: robust and simple.
    • London-open breakout of the Asian range (EURUSD/GBPUSD).
    • RSI(2) mean reversion in a D1 trend (works on indices/gold).