Wide bars are easy to spot after the fact. Also, heartbeat Rhythm Detector, a free candle range indicator TradingView traders can drop on any chart, measures them as they close. It compares the current bar range against the mean and standard deviation of the last 20 ranges, turns that into a z-score, then grades the bar from 0 to 100 using volume and EMA slope alongside it.
It is free and open source. Indeed, you can add it to any chart from the Heartbeat Rhythm Detector script page on TradingView, and the full Pine source is published there for you to read.
What Heartbeat Rhythm Detector plots on the price chart
The script draws a 34-period bias EMA in three stacked layers, so the line reads as a purple glow. Still, triangles mark signals – up below the bar, down above it – each carrying the text PULSE. A label follows every signal and prints the rhythm score out of 100 plus the range z-score. Thus, the background tints once the score clears 50, 70 or 85. The signal bar itself gets recoloured. Hence, a nine-row dashboard sits top right with score, state, range z-score, range CV, CV change, volume ratio, break direction and bars since the last signal.

How Heartbeat Rhythm Detector is built
Step one: measure the rhythm
The script treats bar range as the pulse. Next, it takes high minus low on every bar, then computes the 20-bar simple average and the 20-bar standard deviation of that range. Dividing one by the other gives a coefficient of variation. Then, that number says how uneven recent ranges have been, on a scale that ignores the instrument’s pip size.
A z-score comes next. Yet, the script subtracts the mean range from the current range and divides by the standard deviation. A reading of 2.0 means this bar runs two standard deviations wider than its neighbours, and 2.0 is the default Rhythm Break Z-Score. Truly, the script also compares the current coefficient of variation with its own value 20 bars back, so you can see whether the rhythm is loosening or tightening.
Two context readings support the range work. Plainly, volume gets divided by its 20-bar average. The 34-period EMA supplies a directional bias, and its 3-bar slope gets divided by ATR(14) so the tilt stays comparable across markets.
Step two: score the bar and gate the signal
Four parts build the 0 to 100 rhythm score. Also, the z-score part awards 30 points per unit above 1.0 and caps at 40. A rising coefficient of variation awards 50 points per unit of increase and caps at 25. Indeed, excess volume awards 40 points per unit above the average and caps at 20. The ATR-scaled EMA slope contributes up to 15. Still, add the caps and the ceiling lands exactly on 100.
The score maps to four named states. Under 50 reads REGULAR. From 50 it reads IRREGULAR, from 70 SPIKE, and from 85 ARRHYTHMIA. Thus, those bands drive the background tint and the dashboard colour.
A buy needs several conditions at once. Hence, the z-score must reach 2.0 on a green bar that closes above the previous close. Volume must reach 1.25 times its 20-bar average. Next, close must sit above the 34 EMA with the slope pointing up. The score must reach the 70 threshold. Then, ten bars must also have passed since the last signal. Every signal waits on barstate.isconfirmed, so nothing prints mid-bar.
How to read the signals
Start with the state row. Yet, REGULAR means the market is breathing evenly and the script stays quiet. SPIKE and ARRHYTHMIA mean one bar broke out of the recent range distribution. Truly, the score tells you by how much. It says nothing about what follows.
Read break direction and the EMA together. Plainly, a rhythm break up while price holds above a rising 34 EMA is the case the score was built to catch. The same wide bar against the EMA gets no arrow, because the bias gate blocks it.
Signals land at the close of the qualifying bar, so you act on the next open. Also note that the Rising CV Floor input does not gate signals. It only colours a dashboard row and drives its own alert. Also, CV change already enters the score as a weighted component.

Every Heartbeat Rhythm Detector setting explained
The script exposes 15 inputs, grouped in the settings panel exactly as shown below. Defaults are the published values.
Rhythm Settings
| Setting | What it does | Default | Range |
|---|---|---|---|
| Rhythm Window | Bars used to measure rhythm (range variability) | 20 | 5 to 100 |
| Rhythm Break Z-Score | Current range z-score required to qualify as a rhythm break | 2.0 | 1.0 to 4.0 |
| ATR Length | Sets the atr length used in the calculation. | 14 | 5 to 50 |
| Rising CV Floor | Minimum range coefficient-of-variation increase to count as rhythm shift | 0.2 | 0.05 to 1.0 |
| Volume Average Length | Sets the volume average length used in the calculation. | 20 | 5 to 100 |
| Volume Confirm Multiplier | Sets the volume confirm multiplier used in the calculation. | 1.25 | 1.0 to 3.0 |
| Bias EMA Length | Sets the bias ema length used in the calculation. | 34 | 10 to 200 |
Signal Settings
| Setting | What it does | Default | Range |
|---|---|---|---|
| Rhythm Score Threshold | Sets the rhythm score threshold used in the calculation. | 70 | 40 to 95 |
| Signal Cooldown Bars | Sets the signal cooldown bars used in the calculation. | 10 | 3 to 50 |
Visual Settings
| Setting | What it does | Default | Range |
|---|---|---|---|
| Show Rhythm Dashboard | Toggles show rhythm dashboard on the chart. | on | on / off |
| Show Rhythm Background | Toggles show rhythm background on the chart. | on | on / off |
| Show 3-Layer Signal Glow | Toggles show 3-layer signal glow on the chart. | on | on / off |
| Show Bias EMA Glow | Toggles show bias ema glow on the chart. | on | on / off |
| Buy Color | Colour used for buy color. | #39ff14 | |
| Sell Color | Colour used for sell color. | #ff2d78 |

Alerts built into Heartbeat Rhythm Detector
The script ships 11 alert conditions. Indeed, open the alert dialog on the chart, pick the indicator as the condition source, then choose the event you want. Alerts fire on the close of the bar, so they follow the same confirmed-bar rule the on-chart signals use.
- HRD Buy Pulse
- HRD Sell Pulse
- HRD Any Signal
- HRD Arrhythmia
- HRD Up Break
- HRD Down Break
- HRD Range Z-Spike
- HRD Rising CV
- HRD Webhook JSON
Other markets and timeframes
Every threshold in the script stays relative. Still, the z-score divides by the market’s own range deviation, volume divides by its own average, and the EMA slope divides by ATR. Nothing is quoted in pips or points. Thus, so the defaults move to gold, indices, crypto and equities without retuning. The volume gate is the one caveat. Hence, spot forex volume comes from broker tick counts rather than exchange volume, so treat the 1.25x test there as a proxy.

Limitations worth knowing
This is a volatility event detector, not a trading system. Next, it carries no stop logic, no target logic and no position sizing. It flags a bar whose range broke the recent pattern and points at a direction. Then, it cannot judge whether that break follows through.
Volume sits inside two gates. On instruments with no volume feed the 1.25x test blocks every signal outright. On spot forex the feed is broker tick count, so the same chart can read differently at another broker.
The 10-bar cooldown suppresses a second genuine break that arrives soon after the first. Yet, raise the score threshold and marks get rare. Lower it and clusters appear. Truly, no setting leaves only the good ones behind.
The name is a metaphor. Plainly, the script runs no heart-rate or ECG analysis of any kind. It measures range dispersion with a z-score and a coefficient of variation.
Get Heartbeat Rhythm Detector on TradingView
Open Heartbeat Rhythm Detector on TradingView
If you also trade MetaTrader, the MT4 and MT5 indicator library is available below.
Get the complete indicator library
One email unlocks the full MT4 and MT5 indicator library. Also, this TradingView script stays free on TradingView – the button above adds it to your chart.
Using it alongside MetaTrader
Adding a script on TradingView takes one click, so there is no install step here. Indeed, if you want the same idea on MetaTrader, the MT4 and MT5 indicator installation guide walks through copying files into the data folder and attaching them to a chart. You can also browse the full MetaTrader indicator library, the MT4 indicators section, or the other free TradingView scripts published on this profile. For related chart tools see the MT5 indicators section and the forex trading strategies guides.
External references
- Average true range on Wikipedia
- Donchian Channels at Investopedia
- Candlestick Charts at StockCharts ChartSchool
Frequently asked questions
Does the Heartbeat Rhythm Detector repaint?
No. Still, both the buy and sell booleans include barstate.isconfirmed, and every drawing keys off those same booleans – the triangles, the glow layers, the labels and the bar colour. So a mark appears only after the bar closes, and the historical chart matches what you would have seen live.
What does the rhythm score measure?
It measures how far the current bar departs from recent behaviour. Thus, four weighted parts feed it: range z-score up to 40 points, rising range variability up to 25, excess volume up to 20 and ATR-scaled EMA slope up to 15. It grades the size of the disturbance, not the odds of a trade working.
Which timeframe works best?
Any timeframe, since every input is relative. Hence, higher timeframes produce fewer and heavier marks. On fast intraday charts, raise the Signal Cooldown Bars value above 10 so signals spread further apart.
Why did an obviously large bar get no arrow?
Several gates can block it. Next, the range z-score fell under 2.0, volume missed 1.25 times its average, price sat on the wrong side of the 34 EMA, the score fell under 70, or the cooldown had not elapsed. The dashboard shows each of those readings live, so you can see which one stopped it.
How much should I rely on this indicator?
Treat it as one input, not a decision. Then, it is a chart analysis tool, not trading advice. Test it on your own markets and timeframes before relying on it. Results are not guaranteed; past performance is not indicative of future results.
