Day Type Radar [BullByte]

9 786

More exclusive indicators from BullByte

Subscribe to Ultimate Arsenal for $199.00/month to get exclusive indicators by this author. You pay right on TradingView and can use them on your charts straight away.

Explore Ultimate Arsenal
Day Type Radar is an intraday session classifier. It builds the Initial Balance (IB) and names the session as it develops: Balance, Drive, Trend or Churn.

The IB is the opening range of the session. The script reads what price does around that range and classifies six event types: Drive, Probe-Reject, Accepted Break, Trap, Rotation and Late Expansion.

Made for intraday charts from 1 minute to 4 hours, with the methodology designed around 1 to 15 minutes, across futures, indices, crypto, forex, stocks, ETFs, CFDs and commodities such as gold and oil.

It is a market-reading tool. It does not place orders and it is not a strategy.

---

Purpose

The first question of an intraday session is whether the range edges are holding, or whether a break is developing. Price can change character several times during the same session.

Day Type Radar uses explicit, visible rules to keep that changing context connected. It shows what has happened so far in the session, names the current day type, and keeps a historical ledger of how the script's own event references behaved on the bars loaded on your chart.

---

Why It May Be Useful

• One glance at the Radar Card shows the current day type and plain-language reading.
• The same event definitions are applied consistently across supported markets. ATR and IB-width normalization scale the measurements to the instrument and session, while Sensitivity changes selected ATR-based distance and size thresholds.
• An Accepted Break is not created by a single outside close. Price must continue closing beyond the IB buffer for the required elapsed time.
• Repeated failed breaks can lock the session as Churn instead of continuing to print break-related events.
• You can review how each event class behaved on your own loaded history.

---

Why It Was Built

Intraday price can move from an opening drive to an accepted break, from a failed break to rotation, or from repeated failures to churn. The difficulty is not seeing individual events; it is understanding how those events change the character of the session.

Day Type Radar was built around that problem: connect the sequence, keep the developing state visible, and turn changing price behaviour into one readable day-type story.

syot kilat

---

Is This a Mashup? No

This is one script with one integrated engine. It does not import an external library or merge separate indicators. Standard Pine functions are used for session timing, ATR normalization, rolling price ranges, state tracking and chart presentation.

The event classes share the same session range and session state. The script uses three operating phases, Initial Balance, Balance and Trend, together with a separate Churn lock that can change which events are allowed.

• An Accepted Break changes the session to Trend in that direction.
• Failed breaks are counted and can lock the session as Churn.
• While Churn is locked, new break attempts, Probes, Rotation and Late Expansion are disabled.
• A Drive can establish the directional opening state before the IB is complete.
• The event classes are therefore parts of one connected session model, not separate indicators placed together.

The event rules and state transitions are this script's own implementation of that connected model.

---

What Makes It Different

• Day naming comes from the sequence of events, not from one signal. The Radar Card can show a chain such as IB > Drive up > Probe down > Accept up.
• Elapsed-time acceptance. Acceptance and Trap windows are measured in elapsed minutes and evaluated only on closed bars. The rule is expressed in real time across supported timeframes, while the exact confirmation bar still depends on chart resolution.
• Churn lock. Repeated failures can change the reading of the whole session instead of producing an unlimited sequence of break events.
• Deterministic session definition. Session boundaries are determined by the symbol type and your settings. They do not change simply because more historical bars are loaded.
• Adaptive timing with explicit limits. Some automatic timing values use the longest qualifying measured session length available to the script, with a fallback until a session has been measured. Chart-bar resolution can affect the exact effective timing on higher timeframes.
• Separate event-outcome milestones. The ledger always keeps Reached 1R separate from the last outcome measurement. The first outcome column is always 1R. The Outcome to measure (R) setting changes the last column to Reached 1R, Reached 2R, Reached 3R or Average R.
• Conservative ledger. Events still open at session end are counted as Observed, not Resolved. If price touches a target milestone and the reference boundary on the same bar, the boundary is treated as first.

When Average R is selected, the last column shows the average resolved outcome using the 2R reference target: +2R when the target is reached first and -1R when the reference boundary is reached first. The 1R milestone column remains independent.

Background: "Initial Balance" and day-type concepts are long-standing ideas associated with Market Profile literature. This script uses that vocabulary but does not calculate TPO or volume profiles.

Methodology note: the Initial Balance, opening-drive, range-extension and day-type concepts come from the broader Market Profile framework. The exact percentages, ATR multipliers, timing rules and event thresholds used here are implementation choices intended to make the framework explicit and consistent across different session lengths and chart resolutions. They are not presented as universal Market Profile rules.

---

How It Works

1 - Session

Stocks, funds and indices use the exchange session when Exchange mode is active. In Auto mode, markets configured as anchored markets use a fixed day anchor.

The default Auto anchors are:

• Crypto: UTC full day.
• Forex and EUREX / ICE Europe symbols: London 08:00-16:30.
• Other anchored markets, including US index futures, WTI, gold, other futures, commodities and CFDs: New York 09:30-16:00.

You can force another session mode or anchor in the settings. Custom windows can also be supplied with a selected timezone.

The first loaded session is skipped because it may be partial.

2 - Initial Balance (IB)

The IB is the high-low range of the first part of the session.

Automatic IB timing targets about 16% of the session, with a nominal 120-minute maximum, a minimum of 3 chart bars and additional chart-bar and session constraints. On the New York anchor this is normally about 60 minutes. On the UTC full-day anchor the nominal automatic IB is 120 minutes.

3 - The six events

Every event is evaluated only on a confirmed bar.

• Drive. One evaluation occurs at the Drive checkpoint, targeting about 4% of the session with a nominal 30-minute maximum before chart-bar constraints. A Drive requires sufficient session range in ATR, an opening position near one end of the range and a closing position near the opposite end.

• Probe-Reject. Price pokes beyond an IB edge by the required minimum distance without closing beyond the full break buffer. The event direction points away from the tested edge. A cooldown prevents immediate repeated probes.

• Accepted Break. Price closes beyond the IB edge plus the break buffer and continues closing beyond that condition for the configured elapsed time. The default acceptance time is 15 minutes, measured from the first outside close. A registered Accepted Break changes the session to Trend in that direction.

• Trap. A break attempt closes back to or inside the IB edge within the configured Trap window. The event direction points opposite to the failed break. The default Trap window is 40 minutes from the first outside close.

• Rotation. While the session is balanced and there is no active break attempt, price reaches one IB edge zone and later reaches the opposite edge zone. The event points back across the IB.

• Late Expansion. After 60% of the session, the script looks for a compressed base followed by a tall expansion bar. The base must be within the configured fraction of the IB range, the expansion bar must meet the ATR size requirement, the close must finish near the bar's extreme and, when enabled, the close must also exceed the session high or low established before that breakout bar.

4 - Churn lock

Each failed break increases the failure counter. A failure after an Accepted Break counts double.

At the configured limit, 2 by default, the session locks as Churn. While locked, new break attempts, Probe-Reject, Rotation and Late Expansion events are disabled.

A decisive close beyond an IB edge by the configured release distance can free the session and reset the failure counter.

5 - Day type name

Priority is:

Churn > Trend > Drive > Balance

• Developing: IB is still forming.
• Open drive: a Drive has occurred before the IB is complete.
• Balance day: IB is complete, with no current accepted break or Drive state.
• Drive day: a Drive has occurred without a current accepted break.
• Trend day up or down: an Accepted Break is active.
• Churn: the session is locked.

A failed accepted break removes the Trend state. The session then falls back to its remaining state, such as Drive or Balance.

6 - Limits on new events

By default, each event class is registered once per session. A final percentage of the session is also used as a cutoff that suppresses new event registration near the session end.

---

How to Read the Chart

• Shaded zone with two lines: the Initial Balance. The lines are lighter while the IB is forming and become solid when it is set.
• Zone colour: amber for IB, grey for Balance, green for Trend up, red for Trend down and magenta for Churn.
• Thin line: session open price.
• Dotted session box: surrounds the session and can show the day type, recent event chain, range in ATR, session open time and IB length.
• Text labels: Drive, Accept, Trap and Late identify events. Up events are placed below their bars and down events above them. Hover for event details.
• Small triangles: Probe-Reject and Rotation when the minor-event display is set to Dots.
• Colour strip at the bottom: shows the phase bar by bar.
• Dotted vertical lines: session start and end lines. UTC full-day mode shows day-start lines only.
• Optional: IB +/-1x extensions and Churn Lock / Free markers.

---

The Radar Card

• Title row: Live, History or Session closed, plus the number of currently unresolved events.
• Large row: current day type.
• Next row: the same reading in plain language.
• Info row: symbol, timeframe, asset type, session mode or anchor and session open time.
• IB row: IB low-high, IB width in ATR and session range in ATR.
• Chain row: the last six state/event steps.
• Last row: the most recent event and its time.
• Event table: one row per event class.

Today = whether this event class fired in the current session in Desktop layout.

Observed = registered historical events included in the loaded history. An event still open at session end counts as Observed but not Resolved.

Resolved = events for which the selected target or reference boundary was reached first.

Reached 1R = percentage of resolved events that reached the first 1R milestone before the reference boundary.

Last outcome column = controlled by Outcome to measure (R). It can show Reached 1R, Reached 2R, Reached 3R or Average R.

When a reach option is selected, it shows the percentage of resolved events that reached that target before the reference boundary.

When Average R is selected, it shows the average resolved outcome using the 2R reference target.

The first Reached 1R column is always 1R and does not change with the setting.

An asterisk and dim text indicate fewer than N resolved events, where N is the configured low-sample threshold. Treat those rows as low-sample observations.

The All events row shows totals. Its Today cell is the number of registered events in the current session.

If an event toggle is turned off, that event's row remains visible as off while its chart output, reference levels, ledger counts and alerts are muted. The underlying event logic remains part of the session model.

---

Reference Levels and the Ledger

For each registered event the script can draw illustrative reference geometry:

• Event price: the close of the bar that created the event.
• Reference boundary: the structural level behind the event, such as the IB edge for an Accepted Break. The reference distance is never smaller than the configured ATR floor or 2 ticks.
• R ladder: the ladder starts at 1R and uses the configured outcome target. The target can be 1R, 2R or 3R. When Average R is selected, the reference geometry remains at 2R.

The ledger evaluates subsequent bars to determine which reference condition was reached first:

• An event cannot resolve on its own bar.
• If a bar touches the reference boundary and a target milestone on the same bar, the boundary is treated as first.
• Reached 1R is counted only when 1R is reached before the reference boundary.
• Reached selected R is counted only when the selected target is reached before the reference boundary.
• Average R, when selected, uses the resolved 2R outcome: +2R if the 2R target is reached first, or -1R if the reference boundary is reached first.
• An event still open at session end counts as Observed only and is not counted as Resolved.
• There is no fee, slippage or position-size model. The event price is the signal-bar close.

These are not trade instructions and not strategy results. They describe how the script's own illustrative reference levels behaved on the bars loaded on your chart. They depend on the available historical data and do not predict future results.

Day-Type Stats are off by default. When enabled, the table measures what happened from each recorded day-type read through the end of that session.

• Remaining range: the high-low movement recorded from the read bar to session close, expressed in ATR.
• Close beyond IB: percentage of recorded reads whose session closed outside the IB.
• Follow-through: for directional reads, percentage where the session close finished on the read's side.
• Extension x IB: the maximum extension beyond the IB, expressed in IB widths.

Reads can overlap within a session.

On Mobile layout, the Day-Type Stats table is shortened to keep the dashboard compact and omits Follow-through and Extension x IB.

---

Worked Example (Illustrative Numbers, Not a Real Trade)

Index future, 5-minute chart, New York anchor, Balanced sensitivity, ATR = 6 points.

• 09:30-10:30: the automatic IB forms. IB high 5030, IB low 5000, giving a 30-point range or 5 ATR.

• Edge buffer: the smaller of 0.25 ATR (1.5) and 12% of the IB (3.6), with the configured 2-tick floor also applied. The effective buffer is 1.5 points, so a close above 5031.5 qualifies as outside.

• A bar closing at 10:50 finishes at 5032. This begins an upside break attempt.

• Price continues closing above the required buffer. The bar closing at 11:05 is 15 minutes after the first outside close, so the break is accepted. An Accept up event is registered at that close.

• Reference boundary: IB high at 5030. With a 5036 event price and a 6-point reference distance, the 2R reference level is 5048.

• If 5048 is reached before 5030, the event is counted as Reached 2R. If 5030 is reached first, it is resolved at the reference boundary. If neither is reached before session end, the event remains Observed only.

Alternative path: if the 10:50 close at 5032 is followed by a close at or below 5030 within the Trap window, the upside break attempt has failed and the resulting event points down as Trap down. One failure is counted; repeated failures can eventually lock the session as Churn.

---

Real Chart Example

1. Bitcoin / U.S. Dollar (BTCUSD), 5-minute chart, Crypto, UTC 00:00 day anchor.

The session establishes its Initial Balance first. Price then closes above the IB high and remains outside for the required acceptance time, creating an Accept up event. Later, a downside break attempt fails and price closes back inside the IB, creating a Trap up event.

The chart shows the event's illustrative reference geometry and the current level reached. The Radar Card records the current Balance day reading, IB and session information, and the event chain. The Event Ledger shows the current session alongside historical observed and resolved event results, while the Day-Type Stats panel shows how previous day-type reads behaved through their session closes.

syot kilat

2. S&P 500 E-mini Futures (ES1!), 15-minute chart, Futures, New York 09:30 session.

One session begins with a Drive down, followed by an Accept down, producing a Trend-down read. Repeated failures can then contribute to a Churn / Lock state. Another session shows Probe-Reject and Rotation around the IB without an accepted break. The session text and event chain show how these events build the day-type story, while the Day-Type Stats panel records how historical reads behaved through session close.

syot kilat

---

Recommended Timeframes and Markets

• Best fit: 5m and 15m. These provide enough chart bars for the IB and elapsed-time acceptance rules without the density of very low timeframes.
• 1m and 3m: supported, but naturally produce more chart bars and can appear noisier. Calm sensitivity can be used when fewer events are preferred.
• 30m, 1H and 4H: supported, but there are fewer bars per session, so many event classes will occur less often.
• Markets: index and commodity futures, indices, stocks and ETFs, crypto, forex and CFDs.
• Standard chart types only: Candles, Bars, Line and Area. Heikin Ashi, Renko, Kagi, Line Break, Range and Point & Figure are blocked because they use synthetic or transformed price data.

---

Settings

1 - Session and timing

• Session mode: Auto, Exchange session, Day anchor or Custom window.
• Day anchor: UTC 00:00, Tokyo 09:00, London 08:00 or New York 09:30. Used when the anchor mode is active.
• Custom window and timezone: define a session window and choose Exchange or UTC for the window timezone.
• Display time zone: changes displayed times without changing the session logic.
• Initial Balance minutes: 0 uses automatic timing. Manual values are still constrained by chart-bar and Drive-window rules so the IB cannot collide with the Drive checkpoint.

2 - Sensitivity: Calm, Balanced or Active. Calm uses 1.5x selected ATR-based distance and size thresholds, Balanced uses 1.0x, and Active uses 0.7x. Time windows and the other structural limits are unchanged.

2b - Event toggles: individually enable or mute Drive, Probe-Reject, Accepted Break, Trap, Rotation and Late Expansion in the chart output, reference levels, ledger and alerts. The underlying event logic remains connected to the session model.

3 - Event rules: Accepted Break time, Trap window, Probe distance, break buffer, Drive size and edge tolerance, Rotation edge zone and minimum IB size, Late Expansion compression and bar size, ATR length, Churn lock and release thresholds, final session cutoff, Late Expansion extreme requirement and one-event-per-class behaviour.

4 - Event ledger: Outcome to measure (R) can be 1R, 2R, 3R or Average R. The first Radar Card outcome column remains Reached 1R. The last column follows this setting. Average R uses the 2R reference target. Also includes minimum reference distance in ATR, low-sample threshold and optional outcome markers.

5 - Reference levels: show or hide live reference geometry, show only the latest live event or all unresolved events, and control label distance.

6 - Dashboards: Desktop or Mobile layout, Radar Card on or off, position and text size, Day-Type Stats on or off, position and text size.

7 - Visuals: event labels, label size, Probe and Rotation display style, session box and text, Initial Balance zone, session open line, IB extensions, phase ribbon, Churn markers, session start/end lines and colours.

8 - Alerts: All events or Major only, plus Text or JSON message format.

---

Alerts

Create one alert on this script and choose the condition Any alert() function call.

Alerts are generated once per confirmed bar when an enabled event is registered.

Text alerts include the symbol, timeframe, event, direction, day type, event price, reference boundary and the configured R reference level.

JSON alerts include the symbol, timeframe, event, direction, event price, reference boundary and reference level.

When the outcome setting is Average R, the reference level reported by the alert remains the 2R reference level used by that measurement.

In Major only mode, Probe-Reject and Rotation alerts are skipped.

JSON format is intended for webhook use.

---

Limitations

• Events are evaluated on closed bars only. Once registered, event labels are not moved or rewritten. The Radar Card, session box and unresolved reference levels can continue updating as confirmed bars arrive.
• There is built-in confirmation time. Drive is evaluated at its checkpoint, while an Accepted Break requires the configured elapsed time. Nothing here is a prediction.
• On anchored markets, only the selected anchor window is analyzed. For example, with gold on the New York anchor, movement outside 09:30-16:00 New York is not part of that session's reading.
• The ledger and Day-Type Stats depend on the amount of historical bar data loaded on the chart and the plan's available history.
• The first loaded session is skipped. In Exchange or Custom mode, the first analyzed session uses a 390-minute timing fallback until a qualifying session length has been measured.
• Automatic Drive and IB timing is converted to whole chart bars, so the exact effective checkpoint can differ from the nominal percentage or minute description on higher timeframes.
• With extended hours disabled on stocks and indices, there may be no bar outside the regular session for displaying a session-end line or Session closed state. The next session still settles prior open observations.
• Late Expansion measures its compression base from bars immediately preceding the breakout bar. On an early session check, that lookback can therefore include bars from before the current session began.
• TradingView drawing limits can remove older drawings when platform limits are reached. Historical statistics are maintained separately from chart drawings.
• Event toggles can mute chart output, reference levels, ledger counts and alerts for an event class while the underlying event logic remains part of the session model.
• Behaviour changes with timeframe, session definition and Sensitivity. Test the settings on your own markets and data.

---

Disclaimer

Day Type Radar is an educational market-analysis tool. It is not financial advice and is not a recommendation to buy or sell anything. It does not place orders.

Reference levels, outcome markers and ledger numbers are illustrative calculations based on historical bars. They include no fees, slippage or position sizing, and they do not predict future results.

Trading involves risk of loss. You are responsible for your own decisions.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.