Loading…

Volatility Scaled Momentum System

A plain "biggest movers" momentum scanner is misleading across instruments with different typical volatility: a 150-pip move on a naturally volatile pair and a 40-pip move on a quiet one can represent the same underlying strength, or the opposite, and raw pips or percent cannot tell them apart. This EA scores every candidate symbol as score = (Close[1] - Close[1 + InpMomentumBars]) / ATR(InpAtrPeriod) which expresses the InpMomentumBars-bar move in units of "how many ATRs", a common, size-independent scale that a raw price-change ranking does not have. The InpTopN symbols with the largest |score| get a position in the score's own direction; a symbol that drops out of the top N on a later scan, or whose score flips sign, has its position closed on that same scan. This is a single EA managing a whole basket from one chart, not one instance per symbol - every order is sent with its target symbol passed explicitly to OrderSend, never the chart's own Symbol(), and every position lookup filters the order pool by that same explicit symbol plus this EA's magic number so it never touches a position on a different symbol or opened by something else. Notes and limitations A symbol newly added to Market Watch needs its history to sync before it produces a usable score; the EA calls SymbolSelect(symbol, true) to start that sync as early as possible but will simply skip a symbol on any scan where its history is not ready yet rather than blocking. There is no explicit take-profit; a ranked position is held until it drops out of the top N or its score flips sign, so the effective exit timing depends entirely on how the basket re-ranks over time, not a fixed target. InpRiskPercentEach is risked independently PER open slot, not shared across the basket - with InpTopN positions open simultaneously, total basket risk can reach roughly InpTopN times InpRiskPercentEach of equity if every slot is filled and every stop is hit; size InpRiskPercentEach with that multiplication in mind. No correlation control exists between candidates - several highly correlated pairs (e.g. multiple EUR crosses) can occupy multiple ranked slots at once, effectively concentrating risk in one underlying move rather than diversifying it.

Expert advisor · MT5 · v1.0 · Free

About Volatility Scaled Momentum System

Volatility Scaled Momentum System is an expert advisor (trading robot) for MetaTrader 5 based on ATR. It can size trades from your balance and risk percent. It has 14 settings, such as Symbol list, Momentum bars and Atr period. MQL source code included.

Files in the download: VolScaledMomentumSystem.ex5, VolScaledMomentumSystem.mq5, VolScaledMomentumSystem.txt.

Trading robots can lose money. Check every setting and test on a demo account before using real funds.

Settings

SettingDefaultWhat it does
Symbol listEURUSD,GBPUSD,USDJPY,USDCHF,AUDUSD,USDCAComma-separated candidate symbols
Momentum bars20Lookback bars for the momentum leg of the score
Atr period14ATR period used to volatility-scale the momentum
Top n3Number of top-ranked symbols to hold at once
Min abs score0.5Minimum |score| (in ATRs) required to qualify at all
Scan every seconds60Minimum seconds between full basket re-scans
Use risk sizingtrueSize by percent risk to the stop instead of a fixed lot
Risk percent each0.5Percent of equity risked per open slot, when risk sizing is on
Fixed lots0.10Lot size when risk sizing is off, or as a sizing fallback
Atr mult sl2.0Stop loss distance, multiples of that symbol's ATR
Magic number33401Magic 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 5 open File → Open Data Folder, then go to MQL5 → Experts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 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: ATR · Momentum · Dashboards & Scanners · Multi-Currency · Risk & Lot Size · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria