Gamestudio Links
Zorro Links
Newest Posts
Historical Data with the 64bit FXCM Plugin
by Martin_HH. 01/21/26 21:59
Buy A8 Pro Version
by Spirit. 01/21/26 21:37
ZorroGPT
by TipmyPip. 01/20/26 07:17
Bar missing bug?
by jcl. 01/19/26 10:47
400 free seamless texture pack downl. here !
by NeoDumont. 01/18/26 19:09
FXCM demo test failed
by qin. 01/13/26 13:53
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
4 registered members (qin, Angerbeer, Martin_HH, Spirit), 7,198 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Castromangos, Quantum, stephensdeborah, promfast, joe_kane
19193 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