Could you please fix the candle color, I have tried many times. But still not right. Thanks
_SECTION_BEGIN("Color HH n LL");
ColorMG= IIf(C==O,colorDefault,IIf(C>O,colorGreen,colorRed));
//isHigherHigh() => high>high[1] and high[1]>high[2] and close>close[1] and close[1]>close[2] and close>open and close[1]>open[1] and close[2]>open[2] and low>open[1] and low[1]>open[2] and (open+low)<(open+close)
isHH = high>high[1] and high[1]>high[2] and close>close[1] and close[1]>close[2] and close>open and close[1]>open[1] and
close[2]>open[2] and low>open[1] and low[1]>open[2] and (open+low)<(open+close) ;
//barcolor = (isHH() Blue :na)
//barcolor(isHigherHigh()? blue :na, -1)
//barcolor((isHigherHigh() and close>open)? blue :na, -2)
isLL = low<low[1] and low[1]<low[2] and close<close[1] and close[1]<close[2] and close<open and close[1]<open[1] and
close[2]<open[2] and high<open[1] and high[1]<open[2] ;
//barcolor(isLowerLow()? yellow :na)
//barcolor(isLowerLow()? yellow :na, -1)
//barcolor((isLowerLow() and close<open)? yellow :na, -2)
isHH1 = Ref (H,-1);
isHH2 = Ref (H,-2);
isLL1 = Ref (L,-1);
isLL2 = Ref (L,-2);
ColorHHnLL =
IIf(isHH,ColorBlue,
//IIf(isHH1,ColorBlue,
//IIf(isHH2,ColorBlue,
IIf(isLL,colorYellow,
//IIf(isLL1,colorYellow,
//IIf(isLL2,colorYellow,
colorMG));
Plot(C,"Close",ColorHHnLL,styleCandle );
_SECTION_END();