INVITE-ONLY SCRIPT

TIME-Trading Indicator + Alerts

37
What it is

A Pine Script study that profiles intraday behavior by day+time windows in CET/CEST, verifies it on history, colors the chart by the expected bias & strength, shows tables/heatmaps with backtest stats, and can alert at the start of each window with a full trading summary.

Core ideas

Day is split into 7 CET windows: 0–6, 6–9, 9–12, 12–15, 15–18, 18–22, 22–24
(NYC is unified as 15–18 and 18–22 across the whole script.)

For each weekday & window we have an expectation (Bull/Bear/Neutral/Chop) with a strength 1–5 and a label (e.g., “Skokový rast”, “Výplach”…).

Script backtests those expectations on your chart’s history:

Computes return of each window (log-return from first bar open to last bar close of the window).

Counts Hit-rate (bull window = return>0; bear window = return<0; neutral/chop excluded).

Tracks Avg % drift, t-stat, and sample size N.

Trend regime (Auto/Manual)

Auto (EMA): price vs EMA(length) on a higher timeframe (configurable) + optional slope filter.

Manual override: Bull / Bear / Neutral.

Regime is read without look-ahead (uses previous bar’s regime when closing a window).

What you see

Background shading of the current window
– color family by category (green=bull, red=bear, gray=neutral, orange=chop), shade by strength 1–5.

Optional labels on window change with regime + label text (“Bull • Najsilnejší rast týždňa”).

Forecast panel (bottom-right) listing the next X windows with label & strength.

Results tables (three views):

Heatmap 7×7 (default): weekday × window grid, each cell shows one metric (toggle among Hit-rate / Avg % / t-stat).

Deň (stránkovanie): full stats for a single day (N, Hit-rate, Avg %, t, label).

Split 2× (dlhá): two stacked tables (Mon–Thu, Fri–Sun) to fit small screens.

Alerts (window start)

Optionally fire at the start of every window.

Message includes: weekday + window, expectation label, strength, current regime, recommended action (Long/Short/Wait), Hit-rate %, Avg %, and N.

Create alerts in TV with Condition → Any alert() function call (so the script’s dynamic text is used).

Optional filters (easy to add/adjust): min N, min Hit-rate, only Bull/Bear windows.

Inputs you control

Regime mode, EMA length, higher-TF for trend check, require EMA slope.

CET/CEST timezone (uses “Europe/Bratislava” by default).

Toggles: background, labels, forecast, results view, table text size, heatmap metric.

Alert enable; (we can add min-N / min-HR filters if you want them by default).

How stats are computed (important)

A window’s return is measured strictly inside the window (open of first bar → close of last bar).

The window is credited to the correct weekday even across midnight.

Hit-rate uses only directional windows (Bull/Bear). Neutral/Chop are excluded.

Best practices

Use chart TF that divides an hour (5/15/30/60m) so window boundaries align cleanly.

Read the heatmap primarily by Hit-rate (signal reliability) and cross-check with Avg % (effect size) and t-stat (significance).

Trade at the start of a strong window in the direction of the current regime, exit time-based (end of window) or on PT/SL.

If you want, I can also:

mask/show only cells with N ≥ threshold,

add NYC sub-split toggle off/on,

export stats to CSV,

or add webhooks-friendly compact alert strings.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.