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
2 registered members (AndrewAMD, TipmyPip), 13,353 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
correct use of if with series ? #482182
01/07/21 13:53
01/07/21 13:53
Joined: Jun 2016
Posts: 53
F
faustf Offline OP
Junior Member
faustf  Offline OP
Junior Member
F

Joined: Jun 2016
Posts: 53
hi guys i read a manual https://manual.zorro-project.com/series.htm , in particular this case
// correct use of conditional series
vars X = series(), Y = series();
if(priceClose() > Threshold) {
X[0] = priceClose(); // ok!
Y[0] = SMA(X,100);
...
}

i create the script like this

vars PriceHL = series(priceHigh() - priceLow());
var CellM = SMA(PriceHL, 48) + StdDev(PriceHL, 48);
if (PriceHL() > CellM)
{
printf("\nResult1 = %.f", CellM);
}

but return this error

@PriceHL_00311():syntax error
<if (PriceHL() > CellM)>

i search in manual for this error , but not find

https://zorro-project.com/manual/en/errors.htm

some one can help me ? thankz

Re: correct use of if with series ? [Re: faustf] #482527
02/18/21 12:55
02/18/21 12:55
Joined: Jan 2021
Posts: 22
Singapore
S
strimp099 Offline
Newbie
strimp099  Offline
Newbie
S

Joined: Jan 2021
Posts: 22
Singapore
You’re calling PriceHL as a function which it’s not. It’s a series. I also think CellM is not correctly defined. You need to wrap in series.

Code

If(PriceHL>CellM)


Re: correct use of if with series ? [Re: faustf] #482650
03/12/21 19:40
03/12/21 19:40
Joined: Mar 2021
Posts: 6
Z
ZorroTradeAA Offline
Newbie
ZorroTradeAA  Offline
Newbie
Z

Joined: Mar 2021
Posts: 6
Hi,

strimp099 is right. Prices is a series. I assume you want to compare the recent price with CellM.
How about that:
Code
if(PriceHL[0]>CellM )
...


Moderated by  Petra 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1