[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: plotshapes problem



PureBytes Links

Trading Reference Links

Graham,

Thanks very much for your help.  Your code produces the result I was
wanting; but I'm still confused about why mine was not working.  Is
there something special about PlotShapes that it cannot be used in a
loop?  Why does it work to use PlotText in the loop, but not PlotShapes?

Thanks again,
Richard


--- In amibroker@xxxxxxxxxxxxxxx, Graham <kavemanperth@xxx> wrote:
>
> there are better ways to do this, and you can do it without using a
> loop. However to get you on right track and not take too much time, do
> not place plotshape in loop and define an array for using in it to
> define whcih bars are to be plotted with the shape. Here is a quick
> fix to your code
> I do not guarantee that the shapes are plotted where you want them,
> but this should give you a direction for the corrections
> 
> Plot(C, "", colorWhite, styleCandle);
> bp = bc = 0;
> bcount = 0;
> bperfect = 0;
> for( i = 4; i < BarCount; i++ )
> {
>  if(bcount == 9)
>  {
>        bcount = 0;
>        bperfect = 0;
>  }
>  if(Close[i] < Close[i-4])
>  {
>        bcount++;
>        // for perfection, low of 8 or 9 must be less than lows of
both 6 and 7
>        if(bcount==8)
>        {
>                if((Low[i] < Low[i-1]) AND (Low[i] < Low[i-2]))
>                        bperfect = 1;
>        }
>        if(bcount==9 AND bperfect==0)
>        {
>                if((Low[i] < Low[i-2]) AND (Low[i] < Low[i-3]))
>                        bperfect = 1;
>        }
>  }
>  else
>  {
>        bcount = 0;
>        bperfect =0;
>  }
>  if((bcount == 9) AND (bperfect==1)){
>        PlotText( "" + bcount, i, L[ i ]-.10, colorRed );
>  }
>  else if(bcount)
>        PlotText( "" + bcount, i, L[ i ]-.10, colorYellow );
> bc[i] = bcount;
> bp[i] = bperfect;
> 
> }
> 
> PlotShapes(shapeDigit9*(bc==9 AND bp==1), colorBlue, 0, L, -20);
> 
> -- 
> Cheers
> Graham Kav
> AFL Writing Service
> http://www.aflwriting.com
> 
> 
> On 27/09/2007, richcb750 <rwennis@xxx> wrote:
> > Anyone?  I'm new to AFL, so let me know if I'm doing something
> > completely wrong.
> >
> > Thanks.
> >
> > --- In amibroker@xxxxxxxxxxxxxxx, "richcb750" <rwennis@> wrote:
> > >
> > > Anybody have any ideas on this?
> > >
> > > Thanks.
> > >
> > > --- In amibroker@xxxxxxxxxxxxxxx, "richcb750" <rwennis@> wrote:
> > > >
> > > > The following formula acts right when I use the commented out
PlotText
> > > > line.  But if I use the PlotShapes line instead, the shape is
plotted
> > > > for every bar.  What am I doing wrong with the plotshapes?
> > > >
> > > > Thanks,
> > > > Richard
> > > >
> > > > bcount = 0;
> > > > bperfect = 0;
> > > > for( i = 4; i < BarCount; i++ )
> > > > {
> > > >  if(bcount == 9)
> > > >  {
> > > >     bcount = 0;
> > > >     bperfect = 0;
> > > >  }
> > > >  if(Close[i] < Close[i-4])
> > > >  {
> > > >     bcount++;
> > > >     // for perfection, low of 8 or 9 must be less than lows of
both 6
> > and 7
> > > >     if(bcount==8)
> > > >     {
> > > >             if((Low[i] < Low[i-1]) AND (Low[i] < Low[i-2]))
> > > >                     bperfect = 1;
> > > >     }
> > > >     if(bcount==9 AND bperfect==0)
> > > >     {
> > > >             if((Low[i] < Low[i-2]) AND (Low[i] < Low[i-3]))
> > > >                     bperfect = 1;
> > > >     }
> > > >  }
> > > >  else
> > > >  {
> > > >     bcount = 0;
> > > >     bperfect =0;
> > > >  }
> > > >  if((bcount == 9) AND (bperfect==1)){
> > > >     //PlotText( "" + bcount, i, L[ i ]-.10, colorRed );
> > > >     PlotShapes(shapeDigit9, colorBlue, 0, L[i], -20);
> > > >  }
> > > >  else if(bcount){
> > > >     PlotText( "" + bcount, i, L[ i ]-.10, colorBlack );
> > > >  }
> > > > }
>




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/