roughsleeper
New member
Hey all,
I made a quick study that shows a range I'm looking at for each day, and it's working out nicely per day, but I'd like to plot these clouds/lines in a different way.
I'm trying to plot only yesterday's levels across the entire chart (including today) – back weeks or months – and hide every other level previous to yesterday's levels.
Here's a visual of where I'm at:
and here's what I'm trying to make happen (with lines / clouds etc. same as above) – take yesterday's levels and apply them all the way back. I can't figure out how to do it.
And the code:
any help is appreciated! thanks!
I made a quick study that shows a range I'm looking at for each day, and it's working out nicely per day, but I'd like to plot these clouds/lines in a different way.
I'm trying to plot only yesterday's levels across the entire chart (including today) – back weeks or months – and hide every other level previous to yesterday's levels.
Here's a visual of where I'm at:
and here's what I'm trying to make happen (with lines / clouds etc. same as above) – take yesterday's levels and apply them all the way back. I can't figure out how to do it.
And the code:
Code:
input length = 10;
input averageType = AverageType.WILDERS;
def ATR20 = MovingAverage(averageType, TrueRange(high(period=”DAY”)[1], close(period=”DAY”)[1], low(period=”DAY”)[1]), length)/5;
def ATR25 = MovingAverage(averageType, TrueRange(high(period=”DAY”)[1], close(period=”DAY”)[1], low(period=”DAY”)[1]), length)/4;
plot dailyClose = close(period=”DAY”)[1];
plot high20 = dailyClose + ATR20;
plot high25 = dailyClose + ATR25;
AddCloud(high20, high25, color.LIGHT_GRAY, color.LIGHT_GRAY);
plot low20 = dailyClose - ATR20;
plot low25 = dailyClose - ATR25;
AddCloud(low20, low25, color.LIGHT_GRAY, color.LIGHT_GRAY);
dailyClose.SetDefaultColor(color.LIME);
high20.SetDefaultColor(color.LIGHT_GRAY);
low20.SetDefaultColor(color.LIGHT_GRAY);
high25.SetDefaultColor(color.LIGHT_GRAY);
low25.SetDefaultColor(color.LIGHT_GRAY);
any help is appreciated! thanks!