hi
I am using hourly pivot for finding intraday trend using below afl
If price close below upper range and above lower range then color is yellow in ribbon IIf(C<HPPU AND C>HPPL,colorYellow,31))); at some places (not at all places) color is coming yellow and some places color is coming blue instead of yellow
please see image marked 3 lines ribbon should show yellow instead of blue
please help me to correct the error/code
_SECTION_BEGIN("PriceCandle");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorPink ), styleNoTitle | styleCandle|styleNoLabel );
_SECTION_END();
_SECTION_BEGIN("Hourly Levels");
//////////////////////////////////HOURLY /////////////////////////////////
HH= TimeFrameGetPrice( "H", inHourly, -1) ;
HL= TimeFrameGetPrice( "L", inHourly, -1) ;
HC= TimeFrameGetPrice( "C", inHourly, -1) ;
HPP = (HH + HL + HC)/3;
// PARAMETERS
SHALD = ParamList("HOURLY Pivots", "selected only|all|hide" );
//day
PDP = ParamList("HPP", "SHOW|HIDE" );
HPP2 = (HH + HL)/2;
HPPU = HPP+(HPP-HPP2);
HPPL = HPP-(HPP-HPP2);
// PLOTS
style = IIf(ParamList("Chart style", "styleCandle|styleBar")=="styleCandle",64,128);
//Plot (C,Date ()+" close",11,style);
//day
if ((PDP=="SHOW" OR SHALD=="all") && SHALD!="hide")
Plot (Hpp,"HOURLY Pivot",colorGold,1);PlotText( "HPP : "+Hpp+"", BarCount+3, LastValue(Hpp), colorLime,1);
Plot(HPPU, "",colorGold,styleDashed);
Plot(HPPL, "",colorGold,styleDashed);
//PlotOHLC(PPL,PPU,PPL,PPU,"",colorSkyblue,styleCloud | styleNoLabel);
_SECTION_END();
myc=IIf(C>HPPU,colorBlue,
IIf(C<HPPL,colorRed,//31));
IIf(C<HPPU AND C>HPPL,colorYellow,31)));
Plot(6, "", myC, styleOwnScale| styleArea|styleNoLabel,-0.5,100);