Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, Nymphodora, Quad), 919 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 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