Martingale Dual Basket MT5
- Uzmanlar
- Sürüm: 1.201
- Etkinleştirmeler: 5
Martingale Dual Basket MT5
Designed around XAUUSD grid basket trading on MetaTrader 5 hedging accounts. Chart timeframe is configurable, including M1 and M5. Confirm the broker symbol and pip size before use.
How it works
An MT5 Expert Advisor for independent BUY and SELL grid baskets on hedging accounts. It uses a martingale lot multiplier. In immediate mode, each enabled direction starts on an eligible tick. A single Step input controls both first-position TP and spacing for additional layers. Layers are added against the direction, measured from the latest fill. From layer 2 onward, the EA calculates one common TP price for that direction using its estimated net money target. Each direction restarts independently after its basket closes, unless halted. BUY and SELL entry prices differ because of spread. Paired reset, combined BUY/SELL profit closing, news filters and automatic lookback spacing are not included.
Money units and cent accounts
The money factor is a unit multiplier, not the balance. Basket target = (InpBasketProfit + InpProfitBuffer) × InpMoneyUnitsPerMajor, in the account ledger currency. On an actual USC ledger, target 10 and factor 1 means 10 USC; target 10 and factor 100 means 1,000 USC. For a balance of 1,000 USC, do not enter 1,000 as the factor. Verify account currency, contract size, tick value, lot step, leverage and costs with the broker. Changing the factor also scales emergency loss and estimated exit commission. No minimum safe deposit or profit duration has been established.
Pause, restart and troubleshoot
MANAGE_EXISTING_ONLY prevents new first entries and new layers while continuing eligible basket management. It does not close all positions immediately. Disabling Algo Trading stops EA trade actions, including virtual exits; removing the EA or shutting down MT5 also stops its management. Accepted server TP/SL remain with the broker, but virtual targets require a running, connected terminal or correctly configured VPS. A manual partial close can trigger closure of the rest of that direction. If only one direction trades, inspect Direction, spread, market permissions, margin, pending orders, journal and HALTED status. With ResetSafetyHalt=true, reinitialization clears saved halts and can allow trading to resume; it does not fix the original cause. Existing chart inputs or loaded presets may override new compiled defaults.
Risk and test status
Default lots are 0.01, 0.02, 0.04, 0.08, 0.16 and 0.32: 0.63 per direction, potentially 1.26 across both. Step 65 × pip size 0.1 = 6.5 price units. With FinalSLPips=0, the final shared SL is 65 pips from the last fill after layer 6. There is no strategy SL on layers 1–5 unless another protection intervenes. Margin/cap failures may close a basket earlier and latch a halt. TP is an estimate: slippage, gaps, costs and execution failures can change the realized result. Martingale can cause large losses, including the entire deposit. This release has no verified long-term live track record. Test broker-specific settings before use; no profit guarantee is offered.
Support and licence
Use the product comments or MQL5 private messages for support. Include version, broker symbol, account currency, hedging/netting mode, relevant inputs, timestamp and redacted Experts/Journal errors. Never send passwords or identity documents. The Market grants personal-use rights, not source ownership or resale rights; its activation protection applies to Market-delivered files. Product installation and input support do not include account management. Critical fixes and platform compatibility obligations follow MQL5 rules; ongoing support follows the applicable Market rules. Documentation is available in ten languages; EA inputs and runtime messages remain English.
Input / MT5 label
| Input / MT5 label | Default | Explanation |
|---|---|---|
| InpSymbol | "" | Blank uses the attached chart symbol. A nonblank value must match that chart exactly. |
| InpTimeframe | PERIOD_M5 | Used only to time ENTRY_NEXT_BAR entries. Default M5; immediate grid management remains tick-driven. |
| InpDirection | BOTH_DIRECTIONS | BOTH_DIRECTIONS starts independent BUY and SELL baskets. BUY_ONLY and SELL_ONLY restrict new entries. |
| InpFirstEntry | ENTRY_IMMEDIATE | ENTRY_IMMEDIATE starts on an eligible tick. ENTRY_NEXT_BAR waits for a new selected bar. MANAGE_EXISTING_ONLY blocks new layers too. |
| InpMagic | 26091801 | Nonzero identifier separating EA positions. Use a unique value for independent instances; do not change it with open baskets. |
| InpAllowRealAccount | true | true allows real-account operation when terminal and account permissions also allow it. false blocks EA trade management on real accounts too. |
| InpStartLot | 0.01 | First-position volume in broker lots. Must satisfy the broker minimum and volume step. |
| InpMultiplier | 2.0 | Each layer uses StartLot × Multiplier^(layer−1), rounded down to the broker lot step. |
| InpMaxLayers | 6 | Maximum layers per direction, including the first. Six layers total 0.63 lots with the default sequence. |
| InpPipSize | 0.10 | User-defined price size of one pip. 0.1 means 65 pips = 6.5 price units; verify for each symbol. |
| InpStepPips | 65.0 | One value for first-position TP and every adverse layer gap, measured from the latest fill. |
| InpMaxBasketLots | 0 | 0 disables this additional volume cap. A positive cap must cover the planned total per direction or initialization fails. |
| InpBasketProfit | 10.0 | Estimated net money target for a direction with 2+ layers, multiplied by MoneyUnitsPerMajor. Not a combined BUY/SELL target. |
| InpFinalSLPips | 0.0 | 0 follows Step. Positive values set a separate pip distance for the final shared SL at the maximum layer. |
| InpMoneyUnitsPerMajor | 1.0 | Money-unit multiplier, not balance. Use 1 when entering targets directly in ledger units; 100 converts major units to a verified cent ledger. |
| InpCloseCostPerLot | 0.0 | Estimated future exit commission per lot, multiplied by the money factor. Known booked costs are already included; avoid double-counting. |
| InpProfitBuffer | 0.0 | Extra money buffer added to the basket target before multiplying by the money factor. |
| InpMaxBasketLoss | 0.0 | 0 disables the virtual emergency money-loss threshold. Positive values are scaled by the money factor and apply per direction. |
| InpMaxSpreadPips | 5.0 | Maximum spread in EA pips for new entries/layers only. 0 disables it. Existing management remains eligible. |
| InpDeviationPoints | 30 | Requested execution deviation in broker POINTS, not EA pips. Its effect depends on broker execution mode. |
| InpMinFreeMarginPercent | 20.0 | Required free margin after the estimated new order, as a percentage of current equity. Not a drawdown limit. |
| InpRetrySeconds | 3 | Retry delay in seconds after rejected orders or failed closes; does not promise a fill. |
| InpShowPanel | true | Shows the English chart status panel; does not change strategy calculations. |
| InpResetSafetyHalt | true | true clears saved directional safety halts on initialization. Reattaching/reinitializing may resume trading; investigate the cause first. |
