Ive been tinkering with this breadth indicator and for whatever reason, the first couple bars do not adhere to the color coding I've written.
If I run the ratio through a moving average to smooth it out, there is a total gap in the data for the first several bars. That being said, I need help with
code that will pull the data from the previous day.. so there are no gaps and the code colors the bars correctly.
Hoping a explained this well enough,
Thanks for any help.
cheers,
-N
declare lower;
input market = {default NASDAQ};
def UVOLQ = close(“$UVOL/q”);
def DVOLQ = close(“$DVOL/q”);
def hi = high(“$UVOL/q”);
def lo = low(“$DVOL/q”);
#Nasdaq Breadth ratio
plot NASDratio = if (UVOLQ >= DVOLQ) then (UVOLQ / DVOLQ) else -(DVOLQ / UVOLQ);
#plot nasDratio= simpleMovingAvg(NASDratio1, 3);
#plot nasDratio= simpleMovingAvg(NASDratio1, 3);
nasDratio.AssignValueColor(if nasDratio>nasDratio[1] then Color.white else createcolor(105,105,105));
If I run the ratio through a moving average to smooth it out, there is a total gap in the data for the first several bars. That being said, I need help with
code that will pull the data from the previous day.. so there are no gaps and the code colors the bars correctly.
Hoping a explained this well enough,
Thanks for any help.
cheers,
-N
declare lower;
input market = {default NASDAQ};
def UVOLQ = close(“$UVOL/q”);
def DVOLQ = close(“$DVOL/q”);
def hi = high(“$UVOL/q”);
def lo = low(“$DVOL/q”);
#Nasdaq Breadth ratio
plot NASDratio = if (UVOLQ >= DVOLQ) then (UVOLQ / DVOLQ) else -(DVOLQ / UVOLQ);
#plot nasDratio= simpleMovingAvg(NASDratio1, 3);
#plot nasDratio= simpleMovingAvg(NASDratio1, 3);
nasDratio.AssignValueColor(if nasDratio>nasDratio[1] then Color.white else createcolor(105,105,105));