Loading…

Symbol Rotation Deck

Reviewing thirty symbols one at a time means either opening thirty charts or repeatedly typing the next symbol into the same one. Neither is hands-free, and a Script has no background timer of its own - it runs once and exits the moment OnStart returns, so it cannot simply "schedule" a symbol change and finish. This script's rotation IS its body: a bounded while(!IsStopped()) loop that switches the running chart's symbol, waits the configured dwell time in short polling steps, then moves to the next symbol - the same loop-with-Sleep convention this catalogue uses for any Script that needs to act repeatedly over time, since Scripts (unlike Experts) have no OnTimer. Removing the script from the chart, or clicking its stop control, is read within one poll interval and ends the rotation cleanly - the chart is not left switching in the background unwatched. Each symbol is checked with SymbolSelect() and a live price read before switching to it; a broker that does not offer a listed symbol is skipped and logged rather than silently failing to reach it. Notes and limitations - This is a Script, not an Expert Advisor - it must stay attached and running for the rotation to continue; it cannot run in the background after the chart is closed or the terminal restarted. - A symbol not offered by the current broker (wrong suffix, not in Market Watch, delisted) is skipped and logged, not silently dropped without explanation. - The chart comment used to show the current symbol/position is cleared when the script stops; it does not persist afterward.

Script · MT4 · v1.0 · Free

About Symbol Rotation Deck

Symbol Rotation Deck is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message and is set up for gold (XAUUSD). It has 5 settings, such as Symbol list, Dwell seconds and Loop count. MQL source code included.

Files in the download: SymbolRotationDeck.mq4, SymbolRotationDeck.txt.

Settings

SettingDefaultWhat it does
Symbol listEURUSD,GBPUSD,USDJPY,XAUUSDComma-separated watchlist, in rotation order
Dwell seconds15Seconds spent on each symbol before switching
Loop count0Full passes through the list (0 = run until stopped)
Keep current periodtrueKeep the chart's current timeframe on every switch
Fixed periodPERIOD_CURRENTTimeframe to use when InpKeepCurrentPeriod is false

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 → Scripts.
  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 script onto a chart to run it once.

Download the PDF guide

Tags: Alerts · Gold (XAUUSD) · MT4 Script · MQL4 Source Code

MQL4 & MQL5 scripts · PolyMaria