Currency Strength Rotation Manager
Each currency's strength score is the average trailing rate of change, across every pair in InpBasePairs that currency appears in, added when it is the base currency and subtracted when it is the quote currency - so EUR's score reflects EUR's own performance net of whichever side of the quote it happened to sit on in EURUSD, EURGBP, EURJPY and so on, rather than being read off a single pair. The EA ranks all currencies each closed bar and, if the gap between the strongest and the weakest clears InpMinStrengthGap, looks for a pair in InpBasePairs that actually quotes that pairing (in either direction) and trades it - buying the pair if the strong currency is the base, selling it if the strong currency is the quote. The turnover cap is the point of this project. A plain strongest/weakest rotator recomputes the ranking every bar and rotates every time the order changes even slightly, which mostly pays spread and slippage for no real edge. This EA enforces two independent limits before it will rotate an already-open position: InpMinHoldBars (a position must be held at least this many bars regardless of what the ranking says) and InpMaxRotationsPerDay (a rolling 24-hour cap on how many rotations can happen at all). Both must clear before a stronger ranking is allowed to replace the current holding. Notes and limitations - Holds at most one position at a time, tracked by InpMagicNumber, regardless of which pair it is currently on. - If InpBasePairs does not contain a pair that quotes the current strongest currency against the weakest directly, the EA stays flat that cycle rather than substituting a different pairing. - Ranking is trailing rate of change only, with no volatility adjustment - a low-volatility currency's modest steady gain can rank below a volatile currency's larger, choppier one. - Requires AutoTrading enabled and IsTradeAllowed() true; when trading is disabled the EA logs it and skips that cycle's rotation.
Expert advisor · MT4 · v1.0 · Free
About Currency Strength Rotation Manager
Currency Strength Rotation Manager is an expert advisor (trading robot) for MetaTrader 4 based on ATR. It can size trades from your balance and risk percent. It has 15 settings, such as Currency list, Base pairs and Strength period. MQL source code included.
Files in the download: StrengthRotationManager.ex4, StrengthRotationManager.mq4, StrengthRotationManager.txt.
Trading robots can lose money. Check every setting and test on a demo account before using real funds.
Settings
| Setting | Default | What it does |
|---|---|---|
| Currency list | USD,EUR,GBP,JPY,AUD,CAD,CHF,NZD | Currencies to rank |
| Base pairs | EURUSD,GBPUSD,USDJPY,AUDUSD,USDCAD,USDCH | Universe of tradable pairs |
| Strength period | 48 | Bars used to measure each pair's trailing rate of change |
| Min hold bars | 96 | Minimum bars a position must be held before a rotation is allowed |
| Max rotations per day | 2 | Maximum rotations allowed in any rolling 24h window |
| Min strength gap | 0.15 | Minimum (strongest - weakest) score gap required to hold anything |
| Use risk sizing | false | Size by percent risk instead of a fixed lot |
| Risk percent | 1.0 | Percent of equity risked per trade, when risk sizing is on |
| Fixed lots | 0.10 | Lot size when risk sizing is off, or as a fallback |
| Atr period | 14 | ATR period, used to size the stop |
| Stop atr multiple | 2.5 | Stop distance from entry, in ATR multiples |
| Magic number | 20260902 | Magic number for orders opened by this EA |
| Slippage pips | 3 | Slippage tolerance, in pips |
| Max retries | 5 | Attempts per trade action before giving up |
| Retry wait ms | 500 | Pause between attempts, milliseconds |
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: Currency Strength · Trailing Stop & Break-even · EURUSD · Risk & Lot Size · ATR · MT4 Expert Advisor · MQL4 Source Code