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==============
Unknown Error Message
- JoshM
- Posts: 2195
- Joined: 20 May 2011
- Location: The Netherlands
- Has thanked: 1544 times
- Been thanked: 1565 times
- Contact:
Re: Unknown Error Message
It also doesn't compile here. However, change..
to
(note the missing "_" in the code).
Then it compiles correctly here.
Code: Select all
If myMACD crosses_below UpperBand then Buy Next Bar Market;
If myMACD crosses_above LowerBand then sellshort Next Bar Market;
Code: Select all
If myMACD crosses below UpperBand then Buy Next Bar Market;
If myMACD crosses above LowerBand then sellshort Next Bar Market;
Then it compiles correctly here.
Re: Unknown Error Message
OK, thank you. Someone should correct the "intellisense", though, since I blindly accepted that it was right as suggested.