Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Grant, AndrewAMD), 911 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 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: 48
D
degenerate_762 Offline OP
Newbie
degenerate_762  Offline OP
Newbie
D

Joined: Jul 2021
Posts: 48
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 (47 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: 265
Netherlands
G
Grant Online
Member
Grant  Online
Member
G

Joined: Aug 2017
Posts: 265
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: 48
D
degenerate_762 Offline OP
Newbie
degenerate_762  Offline OP
Newbie
D

Joined: Jul 2021
Posts: 48
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: 928
Spirit Offline

Moderator
Spirit  Offline

Moderator

Joined: Sep 2003
Posts: 928
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: 265
Netherlands
G
Grant Online
Member
Grant  Online
Member
G

Joined: Aug 2017
Posts: 265
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