Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
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
1 registered members (1 invisible), 692 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 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