Loading…

Live Day Type Classifier

Most "day type" indicators only exist as a look-back classification after the fact. This one runs live, updating as the day's own bars form, using two measures built off the day's Initial Balance (IB - the first InpIBMinutes minutes of the session): Range Extension: how far the day's own high/low has already pushed beyond the IB, sized against the IB's own range. A day still mostly contained inside its IB scores toward Range; one that has pushed well beyond it scores toward Trend or Reversal. Directional persistence: a Kaufman-style efficiency ratio - net displacement from the IB midpoint divided by the total bar-to-bar path length travelled to get there. A value near 1 means a fairly straight run in one direction (Trend); a value near 0 means a lot of back-and- forth covering little net ground (Range). A Reversal is armed the moment the day has extended at least InpReversalExtFactor IB-ranges beyond one side and then closed back through the IB midpoint - a failed one-directional push. Once armed, it stays armed for the rest of that day. The three scores are combined and normalised into percentages that sum to 100 and shown both as three oscillator lines in the subwindow and as a plain-text panel with the current dominant call. This is a heuristic scoring model built from two well-known measures, not a fitted statistical classifier - it is meant to give a real-time read worth a glance, not a probability in the formal sense. Notes and limitations - Before the Initial Balance itself closes, no classification exists yet - the panel says so plainly, and the subwindow lines stay blank. - This is a heuristic scoring combination, not a validated statistical model - two well-defined inputs (range extension, efficiency ratio) combined and normalised by a fixed formula, not fitted to this symbol's own history. - The still-forming current bar's values are expected to move tick to tick, the same as any live oscillator - only closed bars' values are permanently fixed. - Day boundaries use broker-time midnight, adjusted for a session that opens after midnight; a broker that pauses trading for part of the day can still shift which calendar day some late bars fall under versus how the broker itself defines its trading day.

Indicator · MT4 · v1.0 · Free

About Live Day Type Classifier

Live Day Type Classifier is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 9 settings, such as Session start hour, Session start minute and Ib minutes. MQL source code included.

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

Settings

SettingDefaultWhat it does
Session start hour0Trading-day anchor hour (broker time, 0-23)
Session start minute0Trading-day anchor minute (0-59)
Ib minutes60Initial Balance length, in minutes
Reversal ext factor1.0IB ranges of extension required to arm a reversal
AlertstrueAlert once when the live dominant call changes
CornerCORNER_LEFT_UPPERPanel corner
X distance10Panel horizontal offset, pixels
Y distance20Panel vertical offset, pixels
Font size10Panel font size

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

Download the PDF guide

Tags: Trend · Trading Sessions · Alerts · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria