Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
6 registered members (TipmyPip, Niels, dBc, Ed_Love, 3run, 1 invisible), 17,577 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 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: 101
O
OptimusPrime Offline
Member
OptimusPrime  Offline
Member
O

Joined: Aug 2018
Posts: 101
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