Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
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
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (blaurock), 750 guests, and 3 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
correct use of if with series ? #482182
01/07/21 13:53
01/07/21 13:53
Joined: Jun 2016
Posts: 49
F
faustf Offline OP
Newbie
faustf  Offline OP
Newbie
F

Joined: Jun 2016
Posts: 49
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 | chip programmers | 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