indicator · own pane · open source
Beta indicator
Beta is a free open-source indicator by @deepwick. Beta here is the ratio of the bar-to-bar price change covariance to the rolling price… Deepwick Script runs a subset of Pine Script.
Running…
Loading chart…
What Beta does
Beta here is the ratio of the bar-to-bar price change covariance to the rolling price variance — a single-instrument serial sensitivity number.
- Beta > 1 = today's move amplified the prior bar (momentum continuation).
- Beta < 1 = today's move dampened the prior bar (mean-reversion tendency).
- Use alongside a market benchmark input for true market beta.
Source code
Deepwick Script, a subset of Pine Script · read-only
//@version=6
indicator("Beta", overlay=false)
len = input.int(20, "Lookback", minval=2, maxval=252)
src = input.source(close, "Source")
colorBg = input.color("color.purple", "Color Bg")
colorNeutral = input.color("color.gray", "Color Neutral")
cov = ta.cum(ta.change(src) * ta.change(src)[1]) / len
var1 = math.pow(ta.stdev(src, len), 2)
beta = cov / var1
hline(1, "Parity", color=colorNeutral)
p_Beta = plot(beta, "Beta", color=colorBg, linewidth=2)
No comments yet.
Sign in to comment.