Gamestudio Links
Zorro Links
Newest Posts
zorro 64bit command line support
by 7th_zorro. 04/20/24 10:06
StartWeek not working as it should
by jcl. 04/20/24 08:38
Data from CSV not parsed correctly
by jcl. 04/20/24 08:32
Zorro FIX plugin - Experimental
by jcl. 04/20/24 08:30
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (7th_zorro, Aku_Aku, 1 invisible), 604 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, howardR, 11honza11, ccorrea, sakolin
19047 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Help with code #480712
07/01/20 21:19
07/01/20 21:19
Joined: Jul 2020
Posts: 2
C
carolthesecond Offline OP
Guest
carolthesecond  Offline OP
Guest
C

Joined: Jul 2020
Posts: 2
function run ()
{
vars Price = series(price());
vars SMA10 = series(SMA(Price, 10));
vars SMA40 = series(SMA(Price, 40));

//Stop = 90 * PIP

var BuyStop, SellStop;

BuyStop = HH(10) + 1*PIP;
SellStop = LL(10) - 1*PIP;

if (dow() == 5 && NumOpenLong == 0 && NumPendingLong == 0 && SMA10[0] > SMA40[0]){
enterLong(0, BuyStop);
}
if(dow() == 5 && NumOpenShort == 0 && NumPendingShort == 0 && SMA10[0] < SMA[0]){
enterShort(0,SellStop);
}
if (dow() != 5 && dow() != 6 && dow() != 7){
exitLong();
exitShort;
}
}

I tried troubleshooting however I keep on getting the same syntax error.

Re: Help with code [Re: carolthesecond] #480713
07/02/20 04:22
07/02/20 04:22
Joined: Mar 2019
Posts: 357
D
danatrader Offline
Senior Member
danatrader  Offline
Senior Member
D

Joined: Mar 2019
Posts: 357
exitShort();

??

Re: Help with code [Re: danatrader] #480725
07/03/20 23:00
07/03/20 23:00
Joined: Jul 2020
Posts: 2
C
carolthesecond Offline OP
Guest
carolthesecond  Offline OP
Guest
C

Joined: Jul 2020
Posts: 2
no thats not it, it claims line 17 has a problem

Re: Help with code [Re: carolthesecond] #480777
07/11/20 12:03
07/11/20 12:03
Joined: Jun 2019
Posts: 24
Q
Qw3rty Offline
Newbie
Qw3rty  Offline
Newbie
Q

Joined: Jun 2019
Posts: 24
Fixed it:

function run ()
{
vars Price = series(price());
vars SMA10 = series(SMA(Price, 10));
vars SMA40 = series(SMA(Price, 40));

//Stop = 90 * PIP

var BuyStop, SellStop;

BuyStop = HH(10) + 1*PIP;
SellStop = LL(10) - 1*PIP;

if (dow() == 5 && NumOpenLong == 0 && NumPendingLong == 0 && SMA10[0] > SMA40[0]){
enterLong(0, BuyStop);
}


if (dow() == 5 && NumOpenShort == 0 && NumPendingShort == 0 && SMA10[0] > SMA40[0]){
enterShort(0, SellStop);
}



if (dow() != 5 && dow() != 6 && dow() != 7){
exitLong();
exitShort();
}
}

It was a formatting issue.

Also exitShort(); would've been your next error.


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1