Add NASDAQ Cumulative New Highs New Lows breadth indicator
This commit is contained in:
parent
fb60515e1f
commit
46fe64f59c
18
nasdaq_cumulative_new_highs_new_lows.pine
Normal file
18
nasdaq_cumulative_new_highs_new_lows.pine
Normal file
@ -0,0 +1,18 @@
|
||||
//@version = 5
|
||||
indicator("NASDAQ Cumulative New Highs New Lows", overlay = true)
|
||||
|
||||
var cumulativeNewHighsLows = float(na)
|
||||
|
||||
newHighs = request.security("HIGQ", "D", close)
|
||||
newLows = request.security("LOWQ", "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