syntax error powerlanguage

Questions about MultiCharts and user contributed studies.
Tex66
Posts: 1
Joined: 07 Apr 2014

syntax error powerlanguage

Postby Tex66 » 07 Apr 2014

hello, anyone can help me I have this code that crashes at compile time

IF MINLIST (B1, B2, B3) <99999 then begin
IF B1 <= B1 AND B2 <= B3 then begin
BUY ("RbUP LE") B1 stop;
end else begin
IF B2 <= B3 THEN BEGIN
BUY ("Rlev LE") B2 stop;
end else begin
BUY ("Break LE") B3 stop;
END;
END;
END;

if t> = notaft and t <> sess1endtime then begin


if marketposition = -1 then
BUYTOCOVER ("exit SX") + entryprice MyStop stop;
if marketposition = 1 then
SELL ("Exit LX") entryprice MyStop-stop;

SELL ("Late SX") high + 0:05 stop;
BUYTOCOVER ("Late LX") Low - 0:05 stop;
end;

Study: B-R (Signal)
Please wait ....
------ Compiled with error (s): ------
syntax error, expecting 'stop', 'limit', 'contracts', or 'shares'
line 124, column 15

User avatar
furytrader
Posts: 353
Joined: 30 Jul 2010
Location: Chicago, IL
Has thanked: 155 times
Been thanked: 217 times

Re: syntax error powerlanguage

Postby furytrader » 07 Apr 2014

Your problem is that you haven't used the correct syntax when it comes to entering orders.

For example, you've written:

Code: Select all

BUY ("RbUP LE") B1 stop;
... when you should use something more like ...

Code: Select all

BUY ("RbUP LE") 1 Contract Next Bar At B1 stop;


Return to “MultiCharts”