TIME-Trading Indicator + Alerts

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.
Script su invito
Solo gli utenti approvati dall'autore possono accedere a questo script. È necessario richiedere e ottenere l'autorizzazione per utilizzarlo. Tale autorizzazione viene solitamente concessa dopo il pagamento. Per ulteriori dettagli, seguire le istruzioni dell'autore riportate di seguito o contattare direttamente Denyzzzz.
TradingView NON consiglia di pagare o utilizzare uno script a meno che non ci si fidi pienamente del suo autore e non si comprenda il suo funzionamento. Puoi anche trovare alternative gratuite e open-source nei nostri script della comunità.
Istruzioni dell'autore
Declinazione di responsabilità
Script su invito
Solo gli utenti approvati dall'autore possono accedere a questo script. È necessario richiedere e ottenere l'autorizzazione per utilizzarlo. Tale autorizzazione viene solitamente concessa dopo il pagamento. Per ulteriori dettagli, seguire le istruzioni dell'autore riportate di seguito o contattare direttamente Denyzzzz.
TradingView NON consiglia di pagare o utilizzare uno script a meno che non ci si fidi pienamente del suo autore e non si comprenda il suo funzionamento. Puoi anche trovare alternative gratuite e open-source nei nostri script della comunità.