EA Hedging
From the Old Kings archive: EA Hedging, an expert advisor (trading robot) for MetaTrader 4. As the name suggests, the idea behind it is hedged buy / sell positions. In the code it works with moving averages, CCI and Parabolic SAR. It raises the lot size after losses (martingale — high risk), has a trading-hours filter and can size trades from your risk. It has 40 settings, for example c1 (default ------------------------), lotsize (default Money management) and MM (default true). 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 EA Hedging
EA Hedging is an expert advisor (trading robot) for MetaTrader 4 based on Moving Average, CCI and Parabolic SAR. It increases the lot size after a losing trade (martingale), trades only in the hours you set (time filter) and can size trades from your balance and risk percent. It has 40 settings, such as C1, Lotsize and MM. MQL source code included.
Files in the download: EA Hedging.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 |
|---|---|---|
| C1 | ---------------------------------- | |
| Lotsize | Money management | |
| MM | true | |
| Risk | 2.0 | Risk per trade (percent of balance) |
| Lots | 0.01 | Trade size in lots |
| C2 | ---------------------------------- | |
| Multiplier | 1.5 | How much the lot size grows after a loss |
| Profit | 0 | |
| Single order profit | 3.0 | |
| Globalprofit | 0 | |
| Pairglobalprofit | 1 | |
| Maximaloss | 0 | |
| Tradesperday | 99 | |
| Openonnewcandle | true | |
| C3 | ---------------------------------- | |
| Space pips | 14 | |
| Space orders | 5 | |
| Space lots | 0.01 | |
| Space1 pips | 50 | |
| Space1 orders | 1 | |
| Space1 lots | 0.02 | |
| Space2 pips | 100 | |
| Space2 orders | 1 | |
| Space2 lots | 0.03 | |
| Space3 pips | 200 | |
| Space3 orders | 99 | |
| Space3 lots | 0.09 | |
| C4 | ---------------------------------- | |
| Magicbuy | 1 | Magic number that tells this EA's orders apart |
| Buycomment | buy | Comment written on the orders |
| Magicsell | 2 | Magic number that tells this EA's orders apart |
| Sellcomment | sell | Comment written on the orders |
| C5 | ---------------------------------- | |
| Time filter | Timer filter (Hour 0-24 Minute 0-59) | |
| Start hour | 00 | Hour when trading starts (server time) |
| Start minute | 00 | |
| Finish hour | 23 | Hour when trading stops (server time) |
| Finish minute | 30 | Hour when trading stops (server time) |
| C6 | ---------------------------------- | |
| Entry1 | Determine entry based on SMA/parabolic |
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 · Martingale · Time Filter · Risk & Lot Size · Moving Average · CCI · Parabolic SAR · MT4 Expert Advisor · MQL4 Source Code