Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Imhotep, opm), 785 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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