Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by M_D. 04/26/24 20:22
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
MT5 bridge not working on MT5 v. 5 build 4160
by EternallyCurious. 04/25/24 20:49
Zorro FIX plugin - Experimental
by flink. 04/21/24 07:12
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (M_D, AndrewAMD, Quad, Ayumi), 806 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
error #476586
03/11/19 13:59
03/11/19 13:59
Joined: May 2018
Posts: 65
T
tuuPaul Offline OP
Junior Member
tuuPaul  Offline OP
Junior Member
T

Joined: May 2018
Posts: 65
i have a problem with my scrip. i wrote script below. this "else if(asset("EUR/JPY"))" error appeared. How to fix error?. Every assets must be own EMA and LinearRegSlope time period. For this script USDJPY has 330,350 and ERUJPY has 480,270. If there will be 10 assets with different EMA and LinearRegSlope time period, how to write simple code?





function arjiljaa1(){
...
if(asset("USD/JPY"))
vars HuvisagchEma = series(EMA(Une,330));
vars HuvisagchRegression = series(LinearRegSlope(HuvisagchEma,350));
else if(asset("EUR/JPY"))
vars HuvisagchEma = series(EMA(Une,480));
vars HuvisagchRegression = series(LinearRegSlope(HuvisagchEma,270));
...

}

function run()
{
...
StartDate = 20100101;
EndDate = 20161231;

while(asset(loop("USD/JPY","EUR/JPY")))
while(algo(loop("code1")))
{
if(Algo == "code1")
ariljaa1();

}

}

Re: error [Re: tuuPaul] #476646
03/18/19 21:10
03/18/19 21:10
Joined: Aug 2018
Posts: 98
O
OptimusPrime Offline
Junior Member
OptimusPrime  Offline
Junior Member
O

Joined: Aug 2018
Posts: 98
You are missing brackets. { }

if (Condition 1)
{


}

else

{



}


Thanks so much,

OptimusPrime


Moderated by  Petra 

Powered by UBB.threads™ PHP Forum Software 7.7.1