MA Cross With Exit EA
From the Old Kings archive: MA Cross With Exit EA, an expert advisor (trading robot) for MetaTrader 4. As the name suggests, the idea behind it is moving averages. In the code it works with moving averages. It raises the lot size after losses (martingale — high risk), moves the stop behind price and can size trades from your risk. It has 40 settings, for example Comment1 (default - Strategy Parameters -), EA Activated (default true) and Time Frame (default Min_60). Before any live use, test it on a demo account and check its lot size, stop loss and trading hours. 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 MA Cross With Exit EA
MA Cross With Exit EA is an expert advisor (trading robot) for MetaTrader 4 based on Moving Average. It increases the lot size after a losing trade (martingale), moves the stop loss behind price (trailing stop / break-even) and can size trades from your balance and risk percent. It has 40 settings, such as Comment1, Ea activated and Time frame. MQL source code included.
Files in the download: MA_Cross_with_Exit_EA.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 |
|---|---|---|
| Comment1 | - Strategy Parameters - | Comment written on the orders |
| Ea activated | true | |
| Time frame | Min_60 | Period or timeframe used by the calculation |
| Order type | Both | |
| Maximum trades open | 3 | |
| Wait mins for next trade | 30 | |
| Ma1 period | 5 | Period or timeframe used by the calculation |
| Ma1 method | SMA | |
| Ma1 price type | CLOSE | |
| Ma2 period | 30 | Period or timeframe used by the calculation |
| Ma2 method | SMA | |
| Ma2 price type | CLOSE | |
| Ma3 period | 10 | Period or timeframe used by the calculation |
| Ma3 method | SMA | |
| Ma3 price type | CLOSE | |
| Max pips away from cross | 10 | |
| Comment2 | - Order magic number. May be used as use | Comment written on the orders |
| Magic n | 123456 | Magic number that tells this EA's orders apart |
| Comment3 | - AutoLots True will calculate Lots auto | Comment written on the orders |
| Risk management | Automatic | Risk per trade (percent of balance) |
| Comment4 | - Automatic Risk, For ex: 2.5 means 2.5% | Comment written on the orders |
| Auto risk percent | 2 | Risk per trade (percent of balance) |
| Auto max risk in total orders | 7 | Risk per trade (percent of balance) |
| Comment5 | - Manual Number of Lots (if not Automati | Comment written on the orders |
| Manual lots | 0.3 | |
| Manual maximum lots | 3.0 | |
| Comment6 | - Maximum price slippage for buy or sell | Comment written on the orders |
| Slippage | 3 | Maximum slippage allowed when opening a trade |
| Comment7 | - Stop loss in Pips - | Comment written on the orders |
| Stop loss | 10 | Stop loss distance |
| Comment8 | - Take profit in Pips - | Comment written on the orders |
| Take profit | 20 | Take profit distance |
| Comment9 | - Trailing Stop in Pips - | Comment written on the orders |
| Trailing stop | 20 | Trailing stop distance or switch |
| Trailing step | 5 | Trailing stop distance or switch |
| Comment10 | - Should the EA use alerts - | Comment written on the orders |
| Sound alert | true | Turn this alert on or off |
| Email alert | false | Turn this alert on or off |
| Comment11 | - Optional EA actions - | Comment written on the orders |
| Ea sounds | true | Turn this alert on or off |
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: Moving Average · Martingale · Trailing Stop & Break-even · Risk & Lot Size · MT4 Expert Advisor · MQL4 Source Code