Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by dr_panther. 05/18/24 11:01
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (7th_zorro, dr_panther), 724 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 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: 52
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 52
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: 295
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

Joined: Aug 2017
Posts: 295
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: 52
D
degenerate_762 Offline OP
Junior Member
degenerate_762  Offline OP
Junior Member
D

Joined: Jul 2021
Posts: 52
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: 295
Netherlands
G
Grant Offline
Member
Grant  Offline
Member
G

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


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