Gamestudio Links
Zorro Links
Newest Posts
2 questions
by jcl. 08/14/20 12:50
New Zorro version 2.30
by jcl. 08/14/20 12:48
Reducing Function Times
by txesmi. 08/14/20 12:13
NeoDumont's open world treadmill project
by NeoDumont. 08/13/20 23:33
Corvitextu texture browser released...
by NeoDumont. 08/13/20 23:19
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 08/13/20 12:00
AUM Magazine
Latest Screens
Untitled Walking Simulator
The Space Between
Pogostuck: Rage With Your Friends
Worst Case Z
Who's Online Now
8 registered members (kvm, AndrewAMD, txesmi, 3run, alibaba, danatrader, Superku, 1 invisible), 485 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Janusz, Sovattha, DonSergio, bigimpactsound, tzw101
18492 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: 220
D
danatrader Online
Member
danatrader  Online
Member
D

Joined: Mar 2019
Posts: 220
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: 23
Q
Qw3rty Offline
Newbie
Qw3rty  Offline
Newbie
Q

Joined: Jun 2019
Posts: 23
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