Mike! thanks!!!! I didn't pay attention of integer conversion of booleans :))

Great solution!!

function non_above (a,b){
  bars = 6; // numero de bars anteriores que no deben haber superado la grafica
  return (  Sum(   (Ref(a, -1) < Ref(b, -1))   , bars) == bars  );
}

Thanks again! 

--- In [email protected], "Mike" <sfclimb...@...> wrote:
>
> See Sum function.
> http://www.amibroker.com/guide/afl/afl_view.php?id=151
> 
> non_above = Sum(Ref(a, -1) < Ref(b, -1), 6) == 6;
> 
> Mike
> 
> --- In [email protected], Pablo Bozzolo <boctulus@> wrote:
> >
> > Hi! could someone help me whith a function ?
> > 
> > The idea es return something like ....
> > 
> > function non_above (a,b){
> >    return (  (Ref (a,-1)<Ref (b,-1)) AND (Ref (a,-2)<Ref (b,-2)) AND (Ref
> > (a,-3)<Ref (b,-3))
> >         AND (Ref (a,-4)<Ref (b,-4)) AND (Ref (a,-5)<Ref (b,-5)) AND (Ref
> > (a,-6)<Ref (b,-6))   AND ... AND ...      );
> > }
> > 
> > And I've tried something but It's no working maybe because I've no idea how
> > work with the last N-bars
> > 
> > function non_above (a,b){
> >   bars = 6; // parameter
> >   above= False;
> >   for( i = BarCount-bars; i<BarCount-1; i++){
> >     if (a[i]>b[i]){
> >       above = True;
> >       break;  // also not working!
> >     }
> >   }
> >   return (NOT above);
> > }
> > 
> > ANY help will be aprecciated! Pablo
> >
>


Reply via email to