Loading…

Session Baton Tracker

A day's net move is easy to see on any chart; which session actually produced it is not, unless a trader manually checks the open and close price around each session boundary. This indicator draws the day's cumulative move (each bar's close minus that day's own opening price) as one continuous line, but in three colours - one per session - that switch exactly at each session handoff, using the split-buffer technique MQL4 needs for a colour-changing line (MQL4 has no DRAW_COLOR_LINE). The result reads as a relay: the line's colour literally shows which session is "carrying the baton" of the day's move at each point in time. At the end of each day (or for the still-forming current day, updated live) a label reports whichever session produced the largest net move that day - its own close-of-session value minus its own open-of-session value, compared across all three sessions by absolute size. On an hour where two sessions overlap (commonly London and New York), the later session in the handoff order is credited with that stretch of the move; this catalogue's judgment call is that overlap flow reads as dominated by the newer session's participants arriving, not the earlier session still finishing up, though a trader who reads it the other way can simply take the label as one interpretation, not a rule. Because the per-day baton assessment only makes sense once a day's bars are walked in order, this indicator recomputes the last InpDaysBack calendar days in full on every update rather than tracking incremental state across ticks - simpler to reason about and, with a modest InpDaysBack, cheap enough to run every tick without a noticeable delay. Notes and limitations - The three plotted legs share one continuous value (cumulative move since the day's own open) and are coloured, not offset - reading them as one line that changes colour, not three independent lines, is the intended view. - Only the most recent InpDaysBack calendar days are ever computed or drawn; older history shows nothing, by design, to bound both object count and per-tick cost. - The overlap-handling rule (later session wins) is a stated judgment call, not a market fact - a bar inside both London and New York hours is always credited to New York here. - The baton label for the still-forming current day updates live and can change session as the day progresses; only a fully completed day's label is final. - A day with no bars falling inside any configured session (all three disabled, or session hours that do not cover the chart's active hours) produces no baton label for that day, since there is nothing to compare. - Purely a visual/analytical overlay - no alerts or trade signals, and no repainting of an already-finalised day's line or label.

Indicator · MT5 · v1.0 · Free

About Session Baton Tracker

Session Baton Tracker is an indicator for MetaTrader 5. It has 10 settings, such as Asian start hour, Asian end hour and London start hour. MQL source code included.

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

Settings

SettingDefaultWhat it does
Asian start hour0Asian session start hour (broker/server time, 0-23)
Asian end hour8Asian session end hour
London start hour8London session start hour
London end hour16London session end hour
New york start hour13New York session start hour
New york end hour21New York session end hour
Days back15Calendar days recomputed/labelled each update
Show baton labeltrueDraw the dominant-session label at the end of each completed day
Label colorclrWhiteBaton label text colour
Label font size8Baton label font size

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 → Indicators.
  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 indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Trading Sessions · MT5 Indicator · MQL5 Source Code

MetaTrader 4 & 5 indicators · PolyMaria