PROTECTED SOURCE SCRIPT
Aggiornato

HPAS – Historical Price Action Statistics

32
HPAS – Historical Price Action Statistics (v7)
A data-driven overview of weekday behavior: price, volatility, and volume.

1) OVERVIEW
HPAS analyzes how each weekday behaves across your selected history. It aggregates daily returns, intraday ranges, and volumes into a compact heatmap table and optionally plots daily range bands (historical & today) on the chart.
Note: All weekday statistics are calculated using UTC-based daily candles for consistent results across markets (especially 24/7 assets like crypto).
The goal is context and probabilities — not signals.

2) HOW IT WORKS
  • Collects daily bar stats: % gain/loss (close vs open), intraday range ((High−Low) ÷ Open × 100), and contracts (volume).
  • Groups data by weekday (Sun–Sat) and computes: win/loss frequencies, average and max moves, average intraday ranges, and average volume.
  • Note: “Weekday” refers to the calendar day in UTC time. This ensures consistency across all assets and exchanges, particularly for 24/7 markets like crypto.
  • Compares average weekday volume to the current 20-day average (% of 20D).
  • Displays results in a color-shaded table; optionally draws historical daily range bands plus today’s projection with optional smoothing.


3) INCLUDED FEATURES
Core metrics
  • Total → Gain / Loss (% of Days): How often the day closes above/below open.
  • Closing → Avg / Max: Average and largest daily % moves up/down.
  • Intrabar (optional) → Avg / Max: Typical and extreme intraday % ranges.
  • Contracts → Avg (K): Average daily volume (shown in thousands).
  • Contracts → %20D: Weekday’s average volume as % of the current 20-day average.


Visualization & UX
  • Heatmap coloring: lower values appear darker; higher values lighter.
  • Current weekday highlight with a left-side triangle.
  • Tooltips on headers explain what/why/how.
  • Dark/Light theme support; Colorblind-safe palette toggle (Okabe–Ito).


Projection Bands
  • Plots historical daily range bands and today’s projected band.
  • Optional smoothing (SMA) for cleaner band movement.
  • Band Smoothing Explained: Applies a simple moving average over recent projection values to reduce sudden jumps in the upper/lower bands.
    Higher values make the range lines steadier but slower to react; lower values show more real-time variability.


4) USAGE TIPS
  • Context, not prediction: Use stats to frame expectations, not to force trades.
  • Cycle awareness: Compare long vs short date windows; behavior can shift across regimes.
  • Volume tells a story: Elevated %20D can hint at increased participation or attention on certain weekdays.
  • Targets & risk: Range bands provide realistic context for sizing stops/targets.
  • Accessibility: Enable Colorblind-safe mode if red/green contrast is hard to read.


5) INTERPRETATION GUIDE
% Gain / % Loss — Frequency of up/down closes. Higher % Gain suggests a bullish weekday bias.

Avg Gain / Avg Loss — Mean daily % move on green/red days. Gauges typical magnitude.

Max Gain / Max Loss — Largest observed daily % change. Sets an upper bound of past extremes.

Hi-Lo Avg / Max — Typical and extreme intraday % ranges. Context for expected volatility.

Contracts Avg (K) — Average daily volume in thousands. Participation proxy.

%20D — Volume vs current 20-day average. 100% = typical, >100% = above-normal, <100% = lighter-than-normal.


6) CREDITS
Inspired by the HPAS concept popularized by Krown Trading and The Caretaker.
Rebuilt and extended for clarity, accessibility, and practical context.

Version: v7 (October 2025)
License: Educational, non-commercial use

Key Inputs (snippet)
Pine Script®
// Projection Bands grpBands = “Projection Bands” showBands = input.bool(true, “Show daily range bands (historical & today)”, group=grpBands) smoothLen = input.int(1, “Band smoothing (days)”, minval=1, maxval=20, group=grpBands)
Note di rilascio
HPAS – Historical Price Action Statistics (v7)
A data-driven overview of weekday behavior: price, volatility, and volume.

1) OVERVIEW
HPAS analyzes how each weekday behaves across your selected history. It aggregates daily returns, intraday ranges, and volumes into a compact heatmap table and optionally plots daily range bands (historical & today) on the chart.
Note: All weekday statistics are calculated using UTC-based daily candles for consistent results across markets (especially 24/7 assets like crypto).
The goal is context and probabilities — not signals.

2) HOW IT WORKS
  • Collects daily bar stats: % gain/loss (close vs open), intraday range ((High−Low) ÷ Open × 100), and contracts (volume).
  • Groups data by weekday (Sun–Sat) and computes: win/loss frequencies, average and max moves, average intraday ranges, and average volume.
  • Note: “Weekday” refers to the calendar day in UTC time. This ensures consistency across all assets and exchanges, particularly for 24/7 markets like crypto.
  • Compares average weekday volume to the current 20-day average (% of 20D).
  • Displays results in a color-shaded table; optionally draws historical daily range bands plus today’s projection with optional smoothing.


3) INCLUDED FEATURES
Core metrics
  • Total → Gain / Loss (% of Days): How often the day closes above/below open.
  • Closing → Avg / Max: Average and largest daily % moves up/down.
  • Intrabar (optional) → Avg / Max: Typical and extreme intraday % ranges.
  • Contracts → Avg (K): Average daily volume (shown in thousands).
  • Contracts → %20D: Weekday’s average volume as % of the current 20-day average.


Visualization & UX
  • Heatmap coloring: lower values appear darker; higher values lighter.
  • Current weekday highlight with a left-side triangle.
  • Tooltips on headers explain what/why/how.
  • Dark/Light theme support; Colorblind-safe palette toggle (Okabe–Ito).


Projection Bands
  • Plots historical daily range bands and today’s projected band.
  • Optional smoothing (SMA) for cleaner band movement.
  • Band Smoothing Explained: Applies a simple moving average over recent projection values to reduce sudden jumps in the upper/lower bands.
    Higher values make the range lines steadier but slower to react; lower values show more real-time variability.


4) USAGE TIPS
  • Context, not prediction: Use stats to frame expectations, not to force trades.
  • Cycle awareness: Compare long vs short date windows; behavior can shift across regimes.
  • Volume tells a story: Elevated %20D can hint at increased participation or attention on certain weekdays.
  • Targets & risk: Range bands provide realistic context for sizing stops/targets.
  • Accessibility: Enable Colorblind-safe mode if red/green contrast is hard to read.


5) INTERPRETATION GUIDE
% Gain / % Loss — Frequency of up/down closes. Higher % Gain suggests a bullish weekday bias.

Avg Gain / Avg Loss — Mean daily % move on green/red days. Gauges typical magnitude.

Max Gain / Max Loss — Largest observed daily % change. Sets an upper bound of past extremes.

Hi-Lo Avg / Max — Typical and extreme intraday % ranges. Context for expected volatility.

Contracts Avg (K) — Average daily volume in thousands. Participation proxy.

%20D — Volume vs current 20-day average. 100% = typical, >100% = above-normal, <100% = lighter-than-normal.


6) CREDITS
Inspired by the HPAS concept popularized by Krown Trading and The Caretaker.
Rebuilt and extended for clarity, accessibility, and practical context.

Version: v7 (October 2025)
License: Educational, non-commercial use

Key Inputs (snippet)
Pine Script®
// Projection Bands grpBands = “Projection Bands” showBands = input.bool(true, “Show daily range bands (historical & today)”, group=grpBands) smoothLen = input.int(1, “Band smoothing (days)”, minval=1, maxval=20, group=grpBands)

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.