OPEN-SOURCE SCRIPT
Volume Run Rate

<h1>Volume Run Rate</h1>
<h2>What it does</h2>
<p>This indicator answers a simple question that raw volume bars can't: <b>"At this point in the trading day, are we trading more or less than usual?"</b></p>
<p>It accumulates volume from the start of each day, expresses that running total as a percentage of the average full-day volume over a lookback window, and then compares the current reading to where the run rate typically sits at the same time of day historically. When today's pace pushes meaningfully above that historical norm (default: more than 2 standard deviations), the background highlights yellow.</p>
<p>Three lines are plotted:</p>
<ul>
<li><b>Green stepline</b> — today's cumulative volume so far, as a % of the average daily total over the lookback window.</li>
<li><b>Gray line</b> — the average run rate at this same time-of-day across the lookback days.</li>
<li><b>Orange crosses</b> — the upper threshold (historical same-time mean + N standard deviations). When the green line breaks above it, the day is participating unusually heavily for this point in the session.</li>
</ul>
<h2>Why intraday cumulative volume vs. history beats looking at volume alone</h2>
<p>A single volume bar tells you only what happened in the last 5 minutes (or 15, or whatever your timeframe is). That's a noisy, low-context signal. Volume is naturally lumpy intraday — the open and close are always heavy, lunch is always thin — so a "big" bar at 10:00 might be completely normal, and a "small" bar at 14:30 might actually be elevated for that time slot. Eyeballing bar height tells you almost nothing about whether real interest is building.</p>
<p>Cumulative volume from the day's open smooths out that bar-to-bar noise and captures a more meaningful quantity: <b>how much total participation has shown up so far today</b>. But "a lot" or "a little" only means something when measured against a baseline. Comparing today's cumulative volume at 11:00 to the typical cumulative volume at 11:00 over the last 20 days gives you a like-for-like read on whether today is unusually busy <i>for where we are in the session</i>. Two standard deviations above that historical mean is statistically rare — roughly the top 2-3% of historical readings at this time slot — which is why it's a useful alert level.</p>
<h2>How to use it</h2>
<p>Volume tends to confirm or contradict price moves. The run rate makes that confirmation legible in real time:</p>
<ul>
<li><b>Breakout validation.</b> Price breaks a key level intraday and the run rate is already running hot above the threshold — participation is real, the move has fuel behind it. Same breakout on a depressed run rate is much more likely to fail or fade.</li>
<li><b>Trend day vs. chop day, early.</b> If the run rate pushes through the upper threshold in the first hour or two, the day is on track for an above-average volume session, which historically correlates with directional follow-through. A run rate stuck near or below the historical average suggests a low-conviction, mean-reverting tape — fade the edges, don't chase.</li>
<li><b>News and event reaction.</b> When something hits the tape, the question isn't "did volume go up" (it almost always does for one bar) but "is the market actually engaging with this." A run rate that gaps above the threshold and stays there says yes. A spike that immediately reverts says the market dismissed it.</li>
<li><b>Distribution and accumulation timing.</b> Sustained elevated run rate at a price plateau, especially near prior highs or lows, suggests something larger going on than the price action alone reveals.</li>
<li><b>Avoiding low-conviction setups.</b> If your trade thesis depends on participation but the run rate is well below average for this time of day, that's a real signal to size down or skip.</li>
</ul>
<h2>Inputs</h2>
<ul>
<li><b>Lookback days</b> — how many prior days to use as the historical baseline. Default 20 (≈ one trading month).</li>
<li><b>Std Dev threshold</b> — how many standard deviations above the historical same-time mean triggers the elevated-volume background. Default 2.0.</li>
<li><b>Exclude weekends</b> — turn on for crypto or other 24/7 markets where weekend sessions have structurally different volume profiles than weekdays. Off by default (correct for traditional Mon-Fri markets).</li>
</ul>
<h2>Notes</h2>
<ul>
<li>Use on intraday timeframes only (anything lower than Daily). On Daily or higher, an error message is shown — the "cumulative vs. history at the same time of day" comparison only makes sense within a day.</li>
<li>The indicator stores every intraday bar's run rate in persistent arrays, which lets it look back further than Pine's standard 5000-bar history limit and compare apples to apples across the full lookback window.</li>
<li>The historical comparison uses the bar's position within the day (1st bar, 2nd bar, etc.), so it works on any intraday timeframe automatically.</li>
</ul>
<h2>What it does</h2>
<p>This indicator answers a simple question that raw volume bars can't: <b>"At this point in the trading day, are we trading more or less than usual?"</b></p>
<p>It accumulates volume from the start of each day, expresses that running total as a percentage of the average full-day volume over a lookback window, and then compares the current reading to where the run rate typically sits at the same time of day historically. When today's pace pushes meaningfully above that historical norm (default: more than 2 standard deviations), the background highlights yellow.</p>
<p>Three lines are plotted:</p>
<ul>
<li><b>Green stepline</b> — today's cumulative volume so far, as a % of the average daily total over the lookback window.</li>
<li><b>Gray line</b> — the average run rate at this same time-of-day across the lookback days.</li>
<li><b>Orange crosses</b> — the upper threshold (historical same-time mean + N standard deviations). When the green line breaks above it, the day is participating unusually heavily for this point in the session.</li>
</ul>
<h2>Why intraday cumulative volume vs. history beats looking at volume alone</h2>
<p>A single volume bar tells you only what happened in the last 5 minutes (or 15, or whatever your timeframe is). That's a noisy, low-context signal. Volume is naturally lumpy intraday — the open and close are always heavy, lunch is always thin — so a "big" bar at 10:00 might be completely normal, and a "small" bar at 14:30 might actually be elevated for that time slot. Eyeballing bar height tells you almost nothing about whether real interest is building.</p>
<p>Cumulative volume from the day's open smooths out that bar-to-bar noise and captures a more meaningful quantity: <b>how much total participation has shown up so far today</b>. But "a lot" or "a little" only means something when measured against a baseline. Comparing today's cumulative volume at 11:00 to the typical cumulative volume at 11:00 over the last 20 days gives you a like-for-like read on whether today is unusually busy <i>for where we are in the session</i>. Two standard deviations above that historical mean is statistically rare — roughly the top 2-3% of historical readings at this time slot — which is why it's a useful alert level.</p>
<h2>How to use it</h2>
<p>Volume tends to confirm or contradict price moves. The run rate makes that confirmation legible in real time:</p>
<ul>
<li><b>Breakout validation.</b> Price breaks a key level intraday and the run rate is already running hot above the threshold — participation is real, the move has fuel behind it. Same breakout on a depressed run rate is much more likely to fail or fade.</li>
<li><b>Trend day vs. chop day, early.</b> If the run rate pushes through the upper threshold in the first hour or two, the day is on track for an above-average volume session, which historically correlates with directional follow-through. A run rate stuck near or below the historical average suggests a low-conviction, mean-reverting tape — fade the edges, don't chase.</li>
<li><b>News and event reaction.</b> When something hits the tape, the question isn't "did volume go up" (it almost always does for one bar) but "is the market actually engaging with this." A run rate that gaps above the threshold and stays there says yes. A spike that immediately reverts says the market dismissed it.</li>
<li><b>Distribution and accumulation timing.</b> Sustained elevated run rate at a price plateau, especially near prior highs or lows, suggests something larger going on than the price action alone reveals.</li>
<li><b>Avoiding low-conviction setups.</b> If your trade thesis depends on participation but the run rate is well below average for this time of day, that's a real signal to size down or skip.</li>
</ul>
<h2>Inputs</h2>
<ul>
<li><b>Lookback days</b> — how many prior days to use as the historical baseline. Default 20 (≈ one trading month).</li>
<li><b>Std Dev threshold</b> — how many standard deviations above the historical same-time mean triggers the elevated-volume background. Default 2.0.</li>
<li><b>Exclude weekends</b> — turn on for crypto or other 24/7 markets where weekend sessions have structurally different volume profiles than weekdays. Off by default (correct for traditional Mon-Fri markets).</li>
</ul>
<h2>Notes</h2>
<ul>
<li>Use on intraday timeframes only (anything lower than Daily). On Daily or higher, an error message is shown — the "cumulative vs. history at the same time of day" comparison only makes sense within a day.</li>
<li>The indicator stores every intraday bar's run rate in persistent arrays, which lets it look back further than Pine's standard 5000-bar history limit and compare apples to apples across the full lookback window.</li>
<li>The historical comparison uses the bar's position within the day (1st bar, 2nd bar, etc.), so it works on any intraday timeframe automatically.</li>
</ul>
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.