Need help compiling a study  [SOLVED]

Questions about MultiCharts and user contributed studies.
Geoguy
Posts: 2
Joined: 02 Sep 2014
Has thanked: 1 time

Need help compiling a study

Postby Geoguy » 02 Sep 2014

Hi, I'm sure this is super simple but I am hung up on getting a study to compile. I keep getting an error saying it is expecting 'bars' at line 20, which is where the first Condition is. Can anybody figure out what I'm doing wrong? Thanks in advance.

Code: Select all

[LegacyColorValue = true];


Inputs:
MAperiod(5),
highof(10),
highsneeded(10);

Variables:
daysaboveMA (0);


IF Close > Average(Close,MAperiod) THEN daysaboveMA = daysaboveMA + 1 ELSE daysaboveMA = 0


Condition1 = daysaboveMA >= highsneeded;
Condition2 = Close >= highestBar(close,highof);


// entry

IF condition1 AND condition2 THEN Sell next bar at close limit;



// exit
IF Close > Average(C,MAperiod) THEN buytocover this bar on close;

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Need help compiling a study  [SOLVED]

Postby TJ » 02 Sep 2014

missing ;

IF Close > Average(Close,MAperiod) THEN daysaboveMA = daysaboveMA + 1 ELSE daysaboveMA = 0 ;

Geoguy
Posts: 2
Joined: 02 Sep 2014
Has thanked: 1 time

Re: Need help compiling a study

Postby Geoguy » 02 Sep 2014

Wow. I need to step away from the computer for a few minutes. So easy and yet I was stuck. Thanks for your help!


Return to “MultiCharts”