Compile Error  [SOLVED]

Questions about MultiCharts and user contributed studies.
Guest

Compile Error

Postby Guest » 26 May 2007

I get the following error when compiling (as an indicator) the example code below. I believe the code is correct as is.

------ Compiled with error(s): ------
Common error
errLine 7, errColumn 40, errLineEnd 7, errColumnEnd 40
---------------------------------------

Inputs: Length(15);

Vars: count(0), LookBack(5), price(c);

For count = 0 to Length - 1
begin
Test = (c[count] – c[count + LookBack]);
end;

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Postby SP » 27 May 2007

You must declare Test as vars too.

Vars: count(0), LookBack(5), price(c),Test(0);

Guest

Postby Guest » 27 May 2007

Thanks for the reply - I forgot to add that in the example I posted. I still get the same error.

Inputs: Length(15);

Vars: count(0), LookBack(5), price(c), Test(0);

For count = 0 to Length - 1
begin
Test = (c[count] – c[count + LookBack]);
end;

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

  [SOLVED]

Postby SP » 28 May 2007

Change the line to
Test = c[count]- (c[count + LookBack]);

Guest

Postby Guest » 28 May 2007

Thanks - looks like that worked.


Return to “MultiCharts”