2ma Crossover EA
2ma Crossover EA is an expert advisor (trading robot) for MetaTrader 4 from the Old Kings collection. Its source code uses moving averages and ATR. 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 Send Long Trades (default TRUE), Send Short Trades (default TRUE) and Signal Candle (default 1). 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 2ma Crossover EA
2ma Crossover EA is an expert advisor (trading robot) for MetaTrader 4 based on Moving Average and ATR. 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 Send long trades, Send short trades and Signal candle. MQL source code included.
It also trades only in the hours you set (time filter).
Files in the download: 2ma crossover 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 |
|---|---|---|
| Send long trades | TRUE | |
| Send short trades | TRUE | |
| Signal candle | 1 | |
| Ma1period | 13 | 21; |
| Ma1shift | 0 | Bar shift (0 = current bar) |
| Ma1method | MODE_LWMA | |
| Ma1price | PRICE_CLOSE | |
| Ma2period | 21 | 55; |
| Ma2shift | 0 | Bar shift (0 = current bar) |
| Ma2method | MODE_EMA | |
| Ma2price | PRICE_CLOSE | |
| Close on opposite signal | TRUE | |
| Min bars between trades of same type | 3 | |
| Masfhi | Price/Ma filter: | |
| Use single ma filter | FALSE | |
| Single ma period | 55 | 55; |
| Single ma shift | 3 | 3; |
| Single ma method | MODE_EMA | MODE_EMA; |
| Single ma price | PRICE_MEDIAN | PRICE_MEDIAN; |
| Lots | 1.0 | Trade size in lots |
| Magic number | 12345 | 0:manual trades |
| Order comment | 2ma crossover EA | Comment written on the orders |
| Slippage | 5 | Maximum slippage allowed when opening a trade |
| S lpips | 90.0 | Stop loss distance |
| T ppips | 500.0 | Take profit distance |
| Atrhi | --ATR for TP/SL-- | |
| Use atr for sl | TRUE | |
| Use atr for tp | false | |
| Atr period | 14 | Period or timeframe used by the calculation |
| Atr time frame | 0 | Period or timeframe used by the calculation |
| Atr multiplier | 3.5 | How much the lot size grows after a loss |
| Behi | ---------------------------------------- | |
| BE | ----BreakEven settings---- | |
| Break even | TRUE | Move the stop to break-even |
| Break even pips | 20 | Move the stop to break-even |
| Break even profit | 5 | Move the stop to break-even |
| Hide break even stop | FALSE | Move the stop to break-even |
| Pips away from visual be | 50 | |
| Sep1 | ---------------------------------------- | |
| JSL | ----JumpingStopLoss settings---- |
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 · Time Filter · Moving Average · ATR · MT4 Expert Advisor · MQL4 Source Code