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

Re: [amibroker] Syntax-Error



PureBytes Links

Trading Reference Links

> Sorry, but I am almost getting mad.
Welcome to the world of programming ;-)

> For at least one hour I am trying this and that
> and all the time I have a syntax error with the
> following code:
> (want to determine the number of the bar where the last high
> occurred before the first visible)

I haven't used this type of code before, but your loop appears to have an
error. It should be i < endbar and not i >= endbar

Bars are zero based so the last bar is barcount - 1

I mention this because you may actually want i <= endbar, but I don't know
for sure. You can try both ways.

Terry

> per=20;
> StartBar=Status("firstvisiblebar");
> EndBar=StartBar-per;
> HiBar=0;
> for ( i = startbar; i >= endbar; i-- )
> (
>       if (H[i-1]> H[i] AND  H[i-1]>HiBar )
>             HiBar=i;>
> 
> )



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

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

<*> 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/