Unknown Error Message

Questions about MultiCharts and user contributed studies.
gpiero
Posts: 2
Joined: 24 Jun 2011

Unknown Error Message

Postby gpiero » 05 Jul 2012

Hi!
I get the following message when I compile a signal. The error message leaves me pretty clueless. Can anyone please tell me what I am doing wrong. See the code below.

------ Compiled with error(s): ------
syntax error, expecting 'bars'
errLine 0, errColumn 0, errLineEnd 0, errColumnEnd 0
causal study: (Function)

=============CODE BEGINS HERE==============
Inputs: FastLength(12), SlowLength(26), BollingerPeriod(10), NumDevs(1);
Variables: myMACD(0), UpperBand(0), LowerBand(0);

myMACD= MACD(Close, FastLength, SlowLength);
UpperBand = BollingerBand(myMACD, BollingerPeriod, NumDevs);
LowerBand = BollingerBand(myMACD, BollingerPeriod, -NumDevs);

If myMACD crosses_below UpperBand then Buy Next Bar Market;
If myMACD crosses_above LowerBand then sellshort Next Bar Market;
=============CODE ENDS HERE==============

User avatar
JoshM
Posts: 2080
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1525 times
Been thanked: 1483 times
Contact:

Re: Unknown Error Message

Postby JoshM » 05 Jul 2012

It also doesn't compile here. However, change..

Code: Select all

If myMACD crosses_below UpperBand then Buy Next Bar Market;
If myMACD crosses_above LowerBand then sellshort Next Bar Market;


to

Code: Select all

If myMACD crosses below UpperBand then Buy Next Bar Market;
If myMACD crosses above LowerBand then sellshort Next Bar Market;

(note the missing "_" in the code).

Then it compiles correctly here.
These users thanked the author JoshM for the post:
TJ

gpiero
Posts: 2
Joined: 24 Jun 2011

Re: Unknown Error Message

Postby gpiero » 05 Jul 2012

OK, thank you. Someone should correct the "intellisense", though, since I blindly accepted that it was right as suggested.


Return to “MultiCharts”