what's wrong with this code again?

Questions about MultiCharts and user contributed studies.
frenchfry
Posts: 8
Joined: 23 Dec 2006

what's wrong with this code again?

Postby frenchfry » 14 Jan 2007

Can somebody please tell me why this code wouldn't compile?

http://www.elitetrader.com/vb/showthread.php?threadid=84690

The code in the first message has a "common error" (very usefull message) with the word "tomorrow". OK... to fix this I change it "tomorrow" to "next bar".

The code in the second message starts with the same symptom but changing "tomorrow" to "next bar" doesn't help because now the compiler has problems with "Market". Changing it to small letters "market" doesn't help.

These seem to be very easy EasyLanguage examples which should compile without any problems. Is there maybe a document which lists the differences between EasyLanguag and PowerLanguage that I could consult before having to post here? Or is it maybe related to the beta version I'm currently using: 2.0.717.1171 Beta?

Thanks.

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 15 Jan 2007

I were able to compile the following code without any problems:

Code: Select all

Inputs: Length(35), StdDevUp(2.0), StdDevDn(-2.0);
Vars: UpBand(0), DnBand(0), Ave(0);


UpBand = BollingerBand(Close,Length,StdDevUp);
DnBand = BollingerBand(Close,Length,StdDevDn);

Ave = Average(Close,Length);


if ( MarketPosition = 0 ) and ( Close > UpBand )
then Buy("BE") next bar at market;

if ( MarketPosition = 0 ) and ( Close < DnBand )
then SellShort("SE") next bar at market;


if ( MarketPosition = 1 ) and ( Close < Ave )
then Sell("LX") this bar at close;

if ( MarketPosition = -1 ) and ( Close > Ave )
then BuyToCover("SX") this bar at close;

frenchfry
Posts: 8
Joined: 23 Dec 2006

Postby frenchfry » 15 Jan 2007

Of course you were able to compile the code after you replace "tomorrow" with "next bar". That's what I tried to tell you. :-)

Let's try again:

1. Can you compile the original code of both messages without any modifications?
2. If yes, which version of Multicharts are you using?
3. If it is the same that I'm using how do you compile the code? As a signal? Or what other differences could there be between your version and mine?

I hope this will bring us further.

Thanks so far.

User avatar
Stanley Miller
Posts: 556
Joined: 26 Jul 2005
Has thanked: 3 times

Postby Stanley Miller » 15 Jan 2007

Of course you were able to compile the code after you replace "tomorrow" with "next bar". That's what I tried to tell you. :-)


I thought you told that:

changing "tomorrow" to "next bar" doesn't help because now the compiler has problems with "Market". Changing it to small letters "market" doesn't help.

frenchfry
Posts: 8
Joined: 23 Dec 2006

Postby frenchfry » 15 Jan 2007

Yes, that's true I wrote that but what I meant was this:

If you follow the Elitetrader l-i-n-k (had to write it that way because of your spam filter) then you will see two messages with two different codes. Both use the word "tomorrow" and therefore can't be compiled.

When I changed in the first code (just like you did in your test) the word "tomorrow" into "next bar" it worked but when I tried to do the same with the code of the second message then even changeing "tomorrow" to "next bar" wasn't successful. The compiler stopped this time at the word "Market" therefore I thought I need to put the word in small letters but that didn't change anything.

But let's forget the second code as I didn't realize that it is not complete yet because the function "MyProprietaryVolatility" is not yet specified.

Anyway... the word "tomorrow" seems to cause an error.


Return to “MultiCharts”