Chris, Thanks for replying so fast.
In my case, Val is not constant, its array just like C. Also, L might not be ref-1, it can be more than 1 bars ago. And I want to know value of XM corrosponding to bar on which L is less than current bar's C- Val. Thanks again, --- In [email protected], ChrisB <[EMAIL PROTECTED]> wrote: > > Hi Jay > > See if this is what you are looking for: > > Val = Param("Val",1.5 , 1, 3, 0.1); > > XM = High;//for argument's sake. > > CminusVal = Close - Val; > Cond1 = Ref(L,-1) < (C-Val); > myXM= ValueWhen ( Ref(L,-1) < (C -Val),XM); > > // run the Exploration to check you values > Filter = 1; > > AddColumn(Val,"Val", 1.2); > AddColumn( XM,"XM", 1.2); > AddColumn (C, "close",1.2); > AddColumn(Ref(L,-1),"ref L",1.2); > AddColumn( CminusVal,"ClessVal",1.2); > AddColumn( Cond1, "Cond1", 1.2); > AddColumn ( myXM, "my XM", 1.2); > > // Plot these to visually check > Plot( myXm,"myXM", colorBlue,1); > Plot( Cond1, "Cond1",colorRed,styleHistogram |styleOwnScale); > > Regards > > ChrisB > > jay_podda wrote: > > > > I want to find value of array XM when L of very first previous bar is > > VAL amount less then current bar C. > > > > The problem with me is when I use valuewhen, in expression if I use > > any array for comparision, I can't compare with current bar. That is, > > if current bar C is 49.50 and VAL is 1.50, I want to get value of XM > > array when that previous bar's L is less than 48. > > >
