Add NYSE Cumulative 52 Week New highs New Lows breadth indicator
This commit is contained in:
parent
b57fe240e7
commit
fb60515e1f
18
nyse_cumulative_new_highs_new_lows.pine
Normal file
18
nyse_cumulative_new_highs_new_lows.pine
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
//@version = 5
|
||||||
|
indicator("NYSE Cumulative New Highs New Lows", overlay = false)
|
||||||
|
|
||||||
|
var cumulativeNewHighsLows = float(na)
|
||||||
|
|
||||||
|
newHighs = request.security("HIGN", "D", close)
|
||||||
|
newLows = request.security("LOWN", "D", close)
|
||||||
|
|
||||||
|
newHighsLows = nz(cumulativeNewHighsLows) + (newHighs - newLows)
|
||||||
|
cumulativeNewHighsLows := newHighsLows
|
||||||
|
|
||||||
|
mean = ta.sma(cumulativeNewHighsLows, 252)
|
||||||
|
stdev = ta.stdev(cumulativeNewHighsLows, 252)
|
||||||
|
zScore = (cumulativeNewHighsLows - mean) / stdev
|
||||||
|
plot(zScore)
|
||||||
|
|
||||||
|
regimeColor = zScore > 0 ? color.green : color.red
|
||||||
|
bgcolor(color.new(regimeColor, transp = 75))
|
Loading…
Reference in New Issue
Block a user