Loading…

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

SettingDefaultWhat it does
Currency listUSD,EUR,GBP,JPY,AUD,CAD,CHF,NZDCurrencies to rank
Base pairsEURUSD,GBPUSD,USDJPY,AUDUSD,USDCAD,USDCHUniverse of tradable pairs
Strength period48Bars used to measure each pair's trailing rate of change
Min hold bars96Minimum bars a position must be held before a rotation is allowed
Max rotations per day2Maximum rotations allowed in any rolling 24h window
Min strength gap0.15Minimum (strongest - weakest) score gap required to hold anything
Use risk sizingfalseSize by percent risk instead of a fixed lot
Risk percent1.0Percent of equity risked per trade, when risk sizing is on
Fixed lots0.10Lot size when risk sizing is off, or as a fallback
Atr period14ATR period, used to size the stop
Stop atr multiple2.5Stop distance from entry, in ATR multiples
Magic number20260902Magic number for orders opened by this EA
Slippage pips3Slippage tolerance, in pips
Max retries5Attempts per trade action before giving up
Retry wait ms500Pause between attempts, milliseconds

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Experts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the expert advisor from the Navigator onto a chart, check the settings, allow Algo/Auto Trading and press OK.
  6. Test it first on a demo account or in the Strategy Tester.

Download the PDF guide

Tags: Currency Strength · Trailing Stop & Break-even · EURUSD · Risk & Lot Size · ATR · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria