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
0 registered members (), 16,232 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
Max and Min of list of series of variables #484931
12/31/21 17:03
12/31/21 17:03
Joined: Jul 2021
Posts: 54
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 54
yo my peoples,

I have a series of independent variables. I'm trying to sort them to return the minimum and maximum of each respective parameter. I have looked through the manual to find that the min and max functions have already been implemented. However, the function only accepts to evaluate two inputs to return the min and max. Please, Is there a way i could have more than two inputs?

Code
max(var x, var y): var

Parameters:
x,y - any var or int.

Returns:
The minimum or maximum of x and y. 

Attached Files
FH5DD3fXEAIE9Mm.jpg (49 downloads)
Re: Max and Min of list of series of variables [Re: degenerate_762] #484932
12/31/21 19:19
12/31/21 19:19
Joined: Aug 2017
Posts: 311
Netherlands
G
Grant Offline
Senior Member
Grant  Offline
Senior Member
G

Joined: Aug 2017
Posts: 311
Netherlands
Yes, by using a for() loop. You can find a couple of variations over here. As a simple alternative you can also use the min/max functions in R or any other language like Python.

Re: Max and Min of list of series of variables [Re: Grant] #484933
12/31/21 20:30
12/31/21 20:30
Joined: Jul 2021
Posts: 54
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 54
Code
vars crosses1 = series(0);
if (1 == 1){
if (...){
...}
}


Yes. Was looking for a cleaner implementation from people smarter than me (i.e zorro team and you respectful Sir).

Re: Max and Min of list of series of variables [Re: degenerate_762] #484935
01/01/22 13:38
01/01/22 13:38
Joined: Sep 2003
Posts: 929
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 929
Look for MinVal and MaxVal.

Re: Max and Min of list of series of variables [Re: Spirit] #484936
01/01/22 17:00
01/01/22 17:00
Joined: Aug 2017
Posts: 311
Netherlands
G
Grant Offline
Senior Member
Grant  Offline
Senior Member
G

Joined: Aug 2017
Posts: 311
Netherlands
Nice, I overlooked that nifty one.


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