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

[amibroker] Re: First looping attempt has syntax error



PureBytes Links

Trading Reference Links

Your code sample is incomplete. But, things that jump out right away are:

1. Use semicolon ';' to separate expressions within the for loop

e.g.
for (i = 0; i < BarCount; i++)

2. Make sure to balance your braces.

e.g.
for (...)
{
  ...
}

3. Make sure all your variables are defined. In the first example you were assigning to savg[i], in the second example you are assigning to asvg[i]. Was that intentional or a typo?

Mike

--- In amibroker@xxxxxxxxxxxxxxx, Ronald Davis <xokie7@xxx> wrote:
>
> My first  looping attempt has a syntax error,   I would appreciate it if a kind soul would fix this syntax error for me!
> -------------------------------------------------------------------------------------------------------------------
> TJ>>plain arithmetic operations (+/-/*) need to be written as loops.,
> 
> Steve, graciously coded this>savg = ( y2F2t50g + Flvg + y2F2t25g + Lavg + Lcvg ) / 5; as the loop shown below
> 
> for ( i = 0, i < BarCount, i ++ )
> {
> savg[i] = ( y2F2t50g[i] + Flvg[i] + y2F2t25g[i] + Lavg[i] + Lcvg[i] ) / 5;
> --------------------------------------------------------------------------------------------------------------------
> So, as a test, I coded this>asvg=(savg+Lavg+Lcvg+svg+Flvg+y2F2t25g)/6;  as the loop per below , and I got a syntax error.
> 
> for ( i = 0, i < BarCount, i ++)
> {
> asvg[i]=(savg[i]+Lavg[i]+Lcvg[i]+svg[i]+Flvg[i]+y2F2t25g[i])/6;
>




------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

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

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/