Would someone be willing to help me/ show a tutorial of how to make a paintbar study from an indicator?
I have a cycle indicator that I want to convert to a paintbar study. All I want is for when the indicator value (CycleLineColor) increases on the next bar it paints the bar green and when the indicator value goes down the next bar it paints the bar red. Doesn't matter if the indicator value is above or below the zero line. Just looking for the bars to paint green or red when the indicator value goes up or down. There could be multiple bars in a row of the same color as long as the signal line keeps increasing/ decreasing. Here is the indicator-
I have a cycle indicator that I want to convert to a paintbar study. All I want is for when the indicator value (CycleLineColor) increases on the next bar it paints the bar green and when the indicator value goes down the next bar it paints the bar red. Doesn't matter if the indicator value is above or below the zero line. Just looking for the bars to paint green or red when the indicator value goes up or down. There could be multiple bars in a row of the same color as long as the signal line keeps increasing/ decreasing. Here is the indicator-
Code:
declare lower;
#plot Data = close;
input FastCycleLength = 5;
input SlowCycleLength = 8;
#def CycleLineColor=DefineGlobalColor(Color.RED);
#input CycleHistColor=Color.BLUE;
#input ZeroLineColor1 = GetColor(1);
DefineGlobalColor("CycleLineColor", Color.RED);
DefineGlobalColor("CyclehistColor", Color.BLUE);
DefineGlobalColor("ZeroLineColor", Color.YELLOW);
def H = high;
def L = low;
#def FastVar(0),SlowVar(0),DiffVar(0);
def FastVar = ExpAverage((H + L) / 2, FastCycleLength);
def SlowVar = Average((H + L) / 2, SlowCycleLength);
def DiffVar = FastVar - SlowVar;
plot pDiffVar = DiffVar;
pDiffVar.SetDefaultColor(GlobalColor("CycleLineColor"));
plot pDiffVar2 = DiffVar;
pDiffVar2.SetDefaultColor(GlobalColor("CycleHistColor"));
plot pZeroLine = 0;
pZeroLine.SetDefaultColor(GlobalColor("ZeroLineColor"));
#Plot1(DiffVar,"Cycle",CycleLineColor);
#Plot2(DiffVar,"CycleHist",CycleHistColor);
#Plot3(0 ,"Zero",ZeroLineColor);