Please have a look at this indicator........I was trying to modify it the way I want so that it makes my work a bit easy........I've plotted the trend ribbon for this indicator at the bottom........it does change into green when the indicator changes to green and also changes to red when the indicator changes to red............but the problem is that it does not change when the indicator color is BLUE...........I've tried many times modifying the code but I was not sucessful............
Can someone please modify the code in the trend ribbon section so that the trend ribbon also turns into blue when the indicator changes to blue.
Can someone please modify the code in the trend ribbon section so that the trend ribbon also turns into blue when the indicator changes to blue.
_SECTION_BEGIN("Unnamed 3");
Plot(100,"",colorBlack,styleDashed);
Plot(-100,"",colorBlack,styleDashed);
n= Param ( "Periods", 9, 1, 200, 1 );
ys1=(High+Low+Close*2)/4;
rk3=EMA(ys1,n);
rk4=StDev(ys1,n);
rk5=(ys1-rk3)*100/rk4;
rk6=EMA(rk5,n);
UP=EMA(rk6,n);
DOWN=EMA(up,n);
Oo=IIf(up<down,up,down);
Hh=Oo;
Ll=IIf(up<down,down,up);
Cc=Ll;
barcolor2=IIf(Ref(oo,-1)<Oo AND Cc<Ref(Cc,-1),colorBlue,IIf(up>down,colorGreen,colorRed));
PlotOHLC( Oo,hh,ll,Cc, "Potential " + Name(), barcolor2, ParamStyle ("Style") );
Plot( 1, /*efines the height of the ribbon in percent of pane width */"ribbon", IIf( up>down, colorLime, IIf( down>up, colorRed, IIf(Ref(oo,-1)<Oo AND Cc<Ref(Cc,-1), colorBlue, colorBlue ))), /* choose color */ styleOwnScale|styleArea|styleNoLabel, -01, 50 );
_SECTION_END();
Plot(100,"",colorBlack,styleDashed);
Plot(-100,"",colorBlack,styleDashed);
n= Param ( "Periods", 9, 1, 200, 1 );
ys1=(High+Low+Close*2)/4;
rk3=EMA(ys1,n);
rk4=StDev(ys1,n);
rk5=(ys1-rk3)*100/rk4;
rk6=EMA(rk5,n);
UP=EMA(rk6,n);
DOWN=EMA(up,n);
Oo=IIf(up<down,up,down);
Hh=Oo;
Ll=IIf(up<down,down,up);
Cc=Ll;
barcolor2=IIf(Ref(oo,-1)<Oo AND Cc<Ref(Cc,-1),colorBlue,IIf(up>down,colorGreen,colorRed));
PlotOHLC( Oo,hh,ll,Cc, "Potential " + Name(), barcolor2, ParamStyle ("Style") );
Plot( 1, /*efines the height of the ribbon in percent of pane width */"ribbon", IIf( up>down, colorLime, IIf( down>up, colorRed, IIf(Ref(oo,-1)<Oo AND Cc<Ref(Cc,-1), colorBlue, colorBlue ))), /* choose color */ styleOwnScale|styleArea|styleNoLabel, -01, 50 );
_SECTION_END();