Hi, You can try substituting a large number when rang is found to be zero.
e.g. rang = High-Low; rang = IIF(rang > 0, rang, 99999); Mike --- In [email protected], "younus...@..." <younus...@...> wrote: > > Hey Guys, > > I am trying to modify an NRx formula. Please find the formula at the bottom > of my message. > > The formula looks at the 'LLV' for the high and low range (rang) in 7 of the > most recent bars on a chart. > > The problem with the RT data is that sometimes it shows data with the same O, > H, L, C and, therefore, results in a zero range value usually around the end > of a trading day). This upsets the whole system, as it identifies it as the > narrow range bar we've been looking for. > > What I need is a small snippet which would tell the system to ignore ranges > with a value equaling zero. > > Can someone please help? > > Thanks, > Younus > > > > > > _N(Title = StrFormat("{{NAME}}- {{INTERVAL}} {{DATE}} O= %g, H= %g, L= %g, C= > %g (%.1f%%) V= " +WriteVal( V, 1.0 ) +"\n{{VALUES}}", O, H, L, C, > SelectedValue( > ROC( C, 1 )) )); > PriceStyle = GetPriceStyle(); > PriceStyleOpt = ParamStyle("Style") | PriceStyle; > > if (PriceStyle==styleCandle) > Plot( C, "", colorBlack, PriceStyleOpt); > else > Plot( C, "", IIf( Close >= Ref(C, -1), colorBlue, colorRed ), > PriceStyleOpt); > > > NRx = ParamList("4 or 7 Days Narrow Range", "All|NR4|NR7"); > > rang=High-Low; > > if (NRx=="NR4" OR NRx=="All") > { > nr4=IIf(rang==LLV(rang,4),shapeDigit4,shapeNone); > PlotShapes(nr4,colorRed,0,L); > } > > if (NRx=="NR7" OR NRx=="All") > { > nr7=IIf(rang==LLV(rang,7),shapeDigit7+shapePositionAbove,shapeNone); > PlotShapes(nr7,colorGreen,0,H); > > } > > InsideBar = Inside() OR (Ref(H, -1)==H AND Ref(L, -1)<L) OR (Ref(H, -1)>H AND > Ref(L, -1)==L); > nr1=IIf(InsideBar, shapeDigit1,shapeNone); > > PlotShapes(nr1,colorBrown,0,(L+H)/2); > GraphXSpace = 5; >
