Hello Reinsley,

Please give your views about the following small change to your code(With your 
permission); It will take care of Complex Fractals (Where Highs or Lows of two 
adjacent bars are equal)

_SECTION_BEGIN( "pivot" );
num = Param( "trend", 4, 1, 6, 1 );
mHHV = HHV(H,num);
mLLV = LLV(L,num);

FirstVisibleBar = Status( "FirstVisibleBar" );
Lastvisiblebar = Status( "LastVisibleBar" );

for ( b = Firstvisiblebar + num; b <= Lastvisiblebar AND b < BarCount -
        num; b++ )
{
    i = num;
    ml = 0;
    mu = 0;

    while ( i > 0 )
    {
       // if ( L[b] <= L[b-i] && L[b] <= L[b+i] )
                if ( L[b] < L[b+i] )
        {
            ml++;
        }

        //if ( H[b] >= H[b-i] && H[b] >= H[b+i] )
                if ( H[b] > H[b+i] )
        {
            mu++;
        }

        i--;
    }

    //if ( ml == num )
        if ( ml == num AND L[B]==mLLV[B])
    {
        PlotText( "\n *\n", b, L[b], colorGreen );
    }

    //if ( mu == num )
        if ( mu == num  AND H[B]==mHHV[B])
    {
        PlotText( " *\n", b, H[b], colorRed );
    }
}

With Ragards

Sanjiv Bansal

--- In [email protected], reinsley <reins...@...> wrote:
>
> 
> Hi,
> 
> This logic works :
> 
> Best regards
> 
> 
> _SECTION_BEGIN( "pivot" );
> num = Param( "trend", 4, 1, 6, 1 );
> 
> FirstVisibleBar = Status( "FirstVisibleBar" );
> Lastvisiblebar = Status( "LastVisibleBar" );
> 
> for ( b = Firstvisiblebar + num; b <= Lastvisiblebar AND b < BarCount - 
> num; b++ )
> {
>      i = num;
>      ml = 0;
>      mu = 0;
> 
>      while ( i > 0 )
>      {
>          if ( L[b] <= L[b-i] && L[b] <= L[b+i] )
>          {
>              ml++;
>          }
> 
>          if ( H[b] >= H[b-i] && H[b] >= H[b+i] )
>          {
>              mu++;
>          }
> 
>          i--;
>      }
> 
>      if ( ml == num )
>      {
>          PlotText( "\n *\n", b, L[b], colorGreen );
>      }
> 
>      if ( mu == num )
>      {
>          PlotText( " *\n", b, H[b], colorRed );
>      }
> }
> _SECTION_END();
> 
> 
> 
> 
> 
> Le 30/12/2009 20:31, nifty46 a écrit :
> >
> >
> > AFL masters, is it posible to plot ******** as text on a specific
> > candle, i m trying buy it ploted above every candle , please help,I need
> > only one ********* at on HB3 And one ******* below L3, THAX IN ADWANCED
> >
> > HB3=HHV(H,20);// MY CONDITION IS EXTRA
> > L3=LLV(L,20);
> > for( P = 0; P < BarCount; P++ )
> > {
> > dist = 1.5*ATR(10);
> > if( HB3[P] ) PlotText( "\n*******\n" + HB3[ P ], P, HB3[ P ]-dist[P],
> > colorGreen );
> > if( L3[P] ) PlotText("*******\n" + L3 [P ], P, L3[ P ]+dist[P], colorRed);
> > }
> >
> > REGARDS NIFTY46
> >
> > 
> 
> 
> -- 
> Best regards
>


Reply via email to