Hi,

You should not be calling array based functions from within a loop.

The first argument to PlotShapes is an array. PlotShapes will take that array 
and plot the indicated shape on a bar by bar basis. By calling that within a 
loop, you are plotting all bars at every bar, using the same shape value at 
each bar for every bar (that's a mouthful, but reread it a few times and 
hopefully it will become more clear).

If you want to build up your own array for when a shape should be drawn, change 
your looping code to populate the array, then call PlotShapes once after the 
loop, passing in your array as the first argument.

e.g.
my_array = 0;
for( i = 0; i < BarCount; i++ )
{
  if( ...some true condition... )
  {  
    my_array[i] = shapeDownTriangle;
  }
  else
  {
    my_array[i] = shapeNone;
  } 
}
PlotShapes(my_array, ...);

Better still would be to use array math to produce the contents of my_array and 
skip the loop entirely.

Mike

--- In [email protected], "schnitt_tt" <schnitt...@...> wrote:
>
> Hi,
> 
> the follow code in Array processing shows a red down triangle if a gap
> appears.
> 
> it_gap     = GapDown();
> PlotShapes( IIf( it_gap,  shapeDownTriangle , shapeNone ), colorRed );
> 
> I tried to do this with loop processing:
> 
> it_gap     = GapDown();
> for( i = 1; i < BarCount; i++ )
> {
>       if( it_gap[i] == True )
>     {
>        PlotShapes(   shapeDownTriangle , colorGreen );
>      }
>      else
>      {
>         PlotShapes(   shapeNone , colorRed );
>      }
> }
> 
> any Idea why this doesn`t show the patterns ... ?
> Are their any Functions that I can`t use while looping ??
> 
> thx for answering
>


Reply via email to