Loading…

Ranked Signal Queue Manager

Any EA with a "maximum concurrent positions" cap has to decide what happens to a signal that fires while every slot is already taken. The usual answer is nothing - the signal is evaluated once, found no room, and discarded. That throws away information: a strong signal that arrived one tick too late gets the same fate as a weak one, and whichever signal happens to fire right as a slot frees up gets the trade, whether or not it was actually the best opportunity available at that moment. This EA queues instead of discarding. When the position cap is full and a new signal fires, it is ranked by how strong it was (how far past its trigger threshold the reading went) and added to a queue. As soon as a slot frees up - a position closes, or the cap simply was not full to begin with - the single highest-ranked signal still in the queue is released and traded, not the oldest one and not just whichever fires next. A queued signal that goes unfilled for too long expires rather than sitting stale indefinitely waiting for a slot. The signal source used here - an RSI extreme-and-reversal check across a configurable symbol list - is deliberately simple. It exists to demonstrate the queue-and-release discipline, which is the actual point of this submission; the ranking and release machinery is independent of where the signal strength score comes from and works the same way with any stronger signal substituted in. Notes and limitations - The RSI signal is intentionally basic and is not tuned for edge - this is a queue manager submission, not a signal-quality submission. - Releases one signal per tick at most, even if several slots free up at once; a burst of closes empties the queue over a few ticks rather than firing several OrderSend calls back to back on the same tick. - If a symbol already carries an open position from this EA when a fresh signal for the same symbol would otherwise queue, the new signal is skipped rather than queued or stacked. - A signal already in the queue that is overtaken by a manual or other- source position on the same symbol is skipped at release time rather than forced through. - Queue state (which signals are waiting, and their rank) lives only in memory for the lifetime of this EA instance - removing it from the chart or restarting the terminal clears the queue.

Expert advisor · MT5 · v1.0 · Free

About Ranked Signal Queue Manager

Ranked Signal Queue Manager is an expert advisor (trading robot) for MetaTrader 5 based on RSI. It has 12 settings, such as Symbol list, Max concurrent and Rsi period. MQL source code included.

Files in the download: RankedSignalQueueManager.ex5, RankedSignalQueueManager.mq5, RankedSignalQueueManager.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,AUDUSD,USDCHFComma-separated symbols to watch
Max concurrent3Maximum simultaneous open positions across all symbols
Rsi period14RSI period used for the example signal
Rsi oversold30.0RSI below this + turning up queues a buy signal
Rsi overbought70.0RSI above this + turning down queues a sell signal
Signal expiry bars20A queued signal older than this many bars is dropped
Lot size0.10Lot size for every release
Stop loss pips40Stop-loss in pips, 0 = none
Take profit pips80Take-profit in pips, 0 = none
Magic27002Magic number for this EA's own trades
Slippage pips5Slippage tolerance in pips
Max retries5Order-send attempts before giving up on a release

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: Buy/Sell Arrows · RSI · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria