Tunnel Martingale
Tunnel Martingale is an expert advisor (trading robot) for MetaTrader 4 from the Old Kings collection. Judging by its name, it is built around martingale money management (bigger lots after a loss — high risk). It raises the lot size after losses (martingale — high risk), places pending orders and moves the stop behind price. It has 40 settings, for example txt01 (default [COMMON]), Start Type (default STStartFromSNR) and Profit Line Color (default clrGold). Watch it on a demo account for a while — robots can behave differently with each broker. Inside: 1 EA file with source code (.mq4) you can open and edit in MetaEditor. Old Kings are classic community tools shared as-is. Not tested by PolyMaria. Try it on a demo account first. Are you the author of this tool? Message us on Telegram (@abumarket_support) and we will credit you or take it down.
Expert advisor · MT4 · v1.0 · Free
About Tunnel Martingale
Tunnel Martingale is an expert advisor (trading robot) for MetaTrader 4. It increases the lot size after a losing trade (martingale), places pending buy/sell stop or limit orders and moves the stop loss behind price (trailing stop / break-even). It has 40 settings, such as Txt01, Start type and Profit line color. MQL source code included.
It also can size trades from your balance and risk percent.
Files in the download: TunnelMartingale.mq4.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Txt01 | [COMMON] | |
| Start type | STStartFromSNR | EA Start Type |
| Profit line color | clrGold | Take Profit line color |
| Text color | clrGold | Text color |
| Upper gap price color | clrDarkOrchid | Upper Gap Price Color |
| Lower gap price color | clrDarkOrange | Lower Gap Price Color |
| Text size | 8 | Text Size |
| Magic number | 8080 | Magic Number |
| Line style | STYLE_SOLID | Line style |
| Line width | 1 | Line width |
| Line height | 10 | Line Height |
| Date time type | DTTLocalTime | Date and Time base |
| Daily start time | 10:00:00 | Start Time (HH:mm:ss) |
| Daily stop time | 00:00:00 | Stop Time (HH:mm:ss) |
| Comment info | TUNNELMARTINGALE | Custom Comment |
| Txt05 | [SLIPPAGE] | |
| Use slippage | false | Use Slippage |
| Closing slippage | 50 | Closing Slippage (if Use Slippage is true) |
| Opening slippage | 50 | Opening Slippage (if Use Slippage is true) |
| Txt02 | [LOT(S)] | |
| Start amount type | SADynamic | Type of Start Lots |
| Start dynamic amount | 0.00005 | Dynamic Lots |
| Start fixed amount | 0.01 | Fixed Lots |
| Txt03 | [MARTINGALE] | |
| Martingale factor | 1 | Martingale Factor |
| Max martingale factor | 50 | Max Martingale Factor (Max Order) |
| Factor multiplier | 1.5 | Martingale Factor Modifier |
| Factor operator | FOMultiply | Factor Operator |
| Martingale gap | 100 | Gaps (points) |
| Max martingale cycle | 3 | Max Cycle (0 = unlimited) |
| Txt04 | [TARGET] | |
| Target type | TTDynamicMoney | Target Type |
| Trailing target type | TTTNone | Trailing Target Type |
| Profit target | 40.0 | Profit Target (in current currency) |
| Profit target multiplier | 0.008 | Target Multiplier (for Dynamic Money) |
| Trailing target | 10.0 | Trailing Profit Target (for Fixed Money) |
| Trailing target multiplier | 0.002 | Trailing Profit Target Multiplier (for Dynamic Money) |
| Use profit loss | false | Enable Max Loss (not applied if TrailingTargetType is TrailingTarget) |
| Profit loss | -9999999 | Max Loss (for Fixed Money) |
| Profit loss multiplier | -9999999 | Max Loss Multiplier (for Dynamic Money) |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
- Test it first on a demo account or in the Strategy Tester.
Tags: Martingale · Pending Orders · Trailing Stop & Break-even · Risk & Lot Size · MT4 Expert Advisor · MQL4 Source Code