Hadi4emacrossheadg
From the Old Kings archive: Hadi4emacrossheadg, an expert advisor (trading robot) for MetaTrader 4. In the code it works with moving averages. It can hold buy and sell positions together, places pending orders and moves the stop behind price. It has 22 settings, for example Take Profit (default 180), Trailing Stop (default 30) and Stop Loss (default 70). Run it in the Strategy Tester and then on a demo account to see how it opens and closes trades. 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 Hadi4emacrossheadg
Hadi4emacrossheadg is an expert advisor (trading robot) for MetaTrader 4 based on Moving Average. It can hold buy and sell positions at the same time (hedging), places pending buy/sell stop or limit orders and moves the stop loss behind price (trailing stop / break-even). It has 22 settings, such as Take profit, Trailing stop and Stop loss. MQL source code included.
It also trades only in the hours you set (time filter) and can size trades from your balance and risk percent.
Files in the download: hadi4emacrossheadg.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 |
|---|---|---|
| Take profit | 180 | Take profit distance |
| Trailing stop | 30 | Trailing stop distance or switch |
| Stop loss | 70 | Stop loss distance |
| Use stop loss | false | Stop loss distance |
| Slippage | 3 | Maximum slippage allowed when opening a trade |
| Hedging take profit | 90 | Take profit distance |
| Hedging stop loss | 70 | Stop loss distance |
| Hedging level | 10 | |
| Use hedging | true | |
| Short ema | 10 | |
| Long ema | 80 | |
| Immediate trade | true | Open trades immediately or wait for cross. |
| Counter trend | true | Use the originally CounterTrend crossing method or not |
| Lots | 1 | Trade size in lots |
| Use money management | true | Use Money Management or not |
| Account is micro | true | Use Micro-Account or not |
| Risk | 10 | 10% |
| Use hour trade | false | |
| From hour trade | 8 | |
| To hour trade | 18 | |
| Show settings | false | |
| Summarized | false |
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: Hedging · Pending Orders · Trailing Stop & Break-even · Time Filter · Risk & Lot Size · Moving Average · MT4 Expert Advisor · MQL4 Source Code