################################
# Original script by Cwparker23#
################################
input Channel_Avg = 12;
input Hide_Channel_Lines = yes;
plot ChannelLow = Lowest(low,Channel_Avg)[Channel_Avg];
plot ChannelHigh = Highest(high,Channel_Avg)[Channel_Avg];
ChannelLow.SetHiding(Hide_Channel_Lines);
ChannelHigh.SetHiding(Hide_Channel_Lines);
PLOT ChannelMid = (ChannelHigh + ChannelLow) / 2;
ChannelMid.SetDefaultColor(Color.red);
ChannelMid.SetLineWeight(1);
def pcr = ChannelHigh - ChannelLow;
def um = ChannelHigh - (pcr * .382);
def lm = ChannelLow + (pcr * .382);
DefineGlobalColor("ChannelCloud",CreateColor(28, 96, 109));
DefineGlobalColor("FIBCloud", Color.oRANGE);
Input ShowChannelCloud = yes;
Input ShowMidCloud = yes;
AddCloud(
if ShowMidCloud then um else Double.NaN,lm , globalColor("FIBCloud"), globalColor("FIBCloud"));
AddCloud(
if ShowMidCloud then ChannelHigh else Double.NaN,um , globalColor("ChannelCloud"), globalColor("ChannelCloud"));
AddCloud(
if ShowChannelCloud then lm else Double.NaN,ChannelLow , globalColor("ChannelCloud"), globalColor("ChannelCloud"));
#--------------------------------------------------------------