Hello Egners. Please find below my idea. Thank you in advance:-
EA Name: Hedged Grid Martingale (Buy + Sell)
Platform: MT4 | No indicators | Any timeframe | Any symbol | Magic Number required
Opening
- Opens 1 BUY + 1 SELL together at market
- Uses starting lot (user input)
Grid (per side, independent)
- Every Grid Gap pips against a side → add another trade on that side
- Lot sequence: 3 × 0.01 → 3 × 0.02 → 3 × 0.03 → 3 × 0.04 … forever (+0.01 every 3 trades)
- No stop loss. No max trades. No max lots. Each side keeps adding until its exit target is hit
- Start lot, lot step, trades-per-tier, grid gap = all user-adjustable
Take Profit (per side)
- TP measured from FIRST entry of that side (not average)
- Buy TP and Sell TP = separate user inputs
- On TP → close all trades on that side, stop opening that side
- Other side keeps running
Break-Even (surviving side only)
- Triggered automatically when one side hits TP
- Surviving side switches to break-even mode and keeps gridding if price moves against it
- Closes when price hits the user-set Break-Even Price (exact price, per side, fully adjustable — $1 to $1000+)
- On hit → close all trades on that side
Reset
- When both sides closed → immediately open new Buy + Sell, lot sequence resets
Filters
- Spread filter — don't open new trades if spread > user-set max
- Slippage — user input
Dashboard (on chart)
- Open trades per side
- Lots per side
- Floating P/L per side + total
- Max Drawdown accrued whilst running (persists across session)
- Current mode per side (Gridding / Break-Even / Closed)
- TP price + Break-Even price per side
- Toggle on/off + corner position
Inputs
| Input | Notes |
|---|
| Magic Number | required |
| Starting Lot | e.g. 0.01 |
| Lot Step | e.g. 0.01 |
| Trades Per Tier | e.g. 3 |
| Grid Gap | pips, e.g. 20 |
| Buy TP | pips from first buy |
| Sell TP | pips from first sell |
| Buy Break-Even Price | exact price |
| Sell Break-Even Price | exact price |
| Max Spread | filter |
| Slippage | |
| Dashboard On/Off + Corner | |
Optional (please include in code, off by default)
- Equity stop / close-all at X% DD
- Max total lots cap
Quote Reply
Report
Member
Credit Hunter
Credits
133
Would it be possible to add these features to the above?
Restart Mode — NEW
User-selectable option with two choices:
| Mode | Behaviour |
|---|
| Mode A — Wait (original) | Winning side closes. EA waits for the surviving side to hit break-even. Only then does it restart the full Buy + Sell cycle |
| Mode B — Restart Immediately | The moment a side hits TP, EA immediately opens a fresh trade on that closed side — without waiting for the other side to close. The surviving side carries on in break-even mode as normal |
- Mode B detail: If Buy hits TP → close Buy, then immediately open a new Buy at market. Sell continues running in break-even mode. So at any moment, both sides can be active at once (one fresh cycle + one surviving basket). Magic number tagging must keep them separate.
- User input: "Restart Mode: Wait / Immediate"
Manual Buttons — NEW
On-chart buttons (top corner, user-adjustable position):
- [ CLOSE ALL BUYS ] — closes every open buy trade (EA's magic number only)
- [ CLOSE ALL SELLS ] — closes every open sell trade (EA's magic number only)
Behaviour notes:
- Buttons must not reset the cycle automatically — they just close the trades
- Add a confirmation popup ("Close all buys? Yes / No") so you don't fat-finger it
- After a manual close, the EA should follow the same restart logic as a normal close (respect Restart Mode setting)
- Optionally add a [ CLOSE ALL ] button for both sides at once