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

Re: [amibroker] Re: FOR and WHILE loop help needed



PureBytes Links

Trading Reference Links

hello,

examplebelow

BreakLoop = False;
Count=0;
for( i= 0; ((i < BarCount) & NOT(BreakLoop)); i++ )
        {      

if((C[i]-L[i])> (H[i]-O[i]))
Count++;
result[i]=Count;
        if (result[i]>100) BreakLoop = True;
        }

Plot(result,"",2,1);

>
> Does anyone know how to declare either an int (not an array) or break
> from a FOR loop?
>
> Sorry for the shameless bump, but I'm really stuck.
>
> --- In amibroker@xxxxxxxxxxxxxxx, "wigg7es" <nwalton@xxxx> wrote:
> >
> >
> > Hi
> >
> > I'm trying to write some code that looks something like the
> following:
> >
> > LookBackVol = Cumvol - stuff;
> > LookBackDay = 1;
> > LookBackTemp = 0;
> > while (LookBackTemp < LookBackVol) {
> >   LookBackTemp[LookBackDay] = LookBackTemp[LookBackDay - 1] + Ref (
> > V, -1 * LookBackDay);
> >   LookBackDay++;
> > }
> >
> > As you may have guessed, it doesn't work. I think I need to make
> > LookBackDay an int, not an array. The problem is, I don't know how
> to
> > do this. I tried using a FOR loop (which declares an int), however
> I
> > want to break out of the loop when LookBackTemp >= LookBackVol,
> > and "break" doesn't seem to work, so I'm all out of ideas.
> >
> > If someone could shed some light on this I'd be so grateful.
> >
> > Thanks,
> > Nathan
>
>
>
>
>
> Check AmiBroker web page at:
> http://www.amibroker.com/
>
> Check group FAQ at: 
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
>
> *Yahoo! Groups Sponsor*
> ADVERTISEMENT
> click here 
> <http://us.ard.yahoo.com/SIG=1298dnjer/M=315388.5543473.6613715.3001176/D=groups/S=1705632198:HM/EXP=1099350196/A=2372354/R=0/SIG=12id813k2/*https://www.orchardbank.com/hcs/hcsapplication?pf=PLApply&media=EMYHNL40F21004SS> 
>
>
>
> ------------------------------------------------------------------------
> *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
>       <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>        
>     * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
>
>
> __________ Information NOD32 1.876 (20040924) __________
>
> Ce message a ete verifie par NOD32 Antivirus System.
> http://www.nod32.com




[Non-text portions of this message have been removed]



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