Loading…

Position Mosaic Panel

Managing several open positions from the terminal's own Trade tab means switching between rows and remembering which one you meant to touch. This panel lays every open position out as its own tile - symbol, side, lot size, open price, current stop and floating P/L - with three action buttons underneath: Half closes half the position, BE moves the stop to breakeven, and Trail advances the stop one step toward price. The reason every button carries its ticket number in its own object name (e.g. PMP_HALF_123456) rather than a row index is that the tile grid rebuilds every refresh: a position opening or closing elsewhere on the account would silently shift a row-index-based button onto the wrong trade the next time the grid redraws. Reading the ticket back out of the clicked object's own name means every action always resolves to exactly one ticket-scoped OrderSelect, regardless of what else changed on the account since the tile was drawn. Half closes the position's lot size rounded to the symbol's own lot step; if that rounding would leave a remainder below the symbol's minimum lot (an unfillable partial close), it closes the whole position instead rather than sending a request the broker would reject. BE and Trail both check the broker's stop and freeze level before sending a modify, and Trail only ever tightens the stop toward profit - a click that would loosen an existing stop is refused rather than acted on. Notes and limitations - Half, BE and Trail act on exactly one ticket per click; there is no "apply to all tiles" bulk action by design, to keep every click deliberate on real open risk. - Trail applies one fixed step per click rather than running as an automatic background trailing stop - it is a manual "nudge the stop" control, not a set-and-forget trailer. - Tiles refresh on a timer, so floating P/L and stop levels can lag live price briefly between refreshes; actions themselves always read the order fresh at the moment the button is clicked. - Pending orders (stops/limits) are not shown as tiles - only open market positions, since Half/BE/Trail have no meaning on an order that has not yet filled.

Expert advisor · MT4 · v1.0 · Free

About Position Mosaic Panel

Position Mosaic Panel is a script for MetaTrader 4. It has 11 settings, such as Magic filter, Tiles per row and Refresh secs. MQL source code included.

Files in the download: PositionMosaicPanel.ex4, PositionMosaicPanel.mq4, PositionMosaicPanel.txt.

Settings

SettingDefaultWhat it does
Magic filter00 = show every open position, else only this magic number
Tiles per row3Tiles per row in the mosaic grid
Refresh secs2Panel refresh interval, in seconds
Breakeven pips1Pips beyond entry the breakeven stop is placed (covers spread/slippage)
Trail step pips15Distance, in pips, behind price a Trail click sets the stop
Slippage pips3Slippage tolerance, in pips
Max retries5Attempts per action before giving up
Retry wait ms500Pause between attempts, milliseconds
CornerCORNER_LEFT_UPPERPanel corner
X offset10Horizontal offset from the corner, in pixels
Y offset20Vertical offset from the corner, in pixels

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: Grid · Trailing Stop & Break-even · Risk & Lot Size · MT4 Expert Advisor · MQL4 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria