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
3 registered members (AndrewAMD, Grant, Neb), 908 guests, and 6 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
Page 2 of 2 1 2
Re: Math problem... [Re: MMike] #295379
10/24/09 21:08
10/24/09 21:08
Joined: May 2008
Posts: 301
Oxy Offline
Senior Member
Oxy  Offline
Senior Member

Joined: May 2008
Posts: 301
if the reaction is 1:1 (one unit to one unit)
Then the percentage is:

(min : max) * 100

example: 90 units A and 120 units B

(90 : 120) = 0.75
0.75 * 100 = 75%


example: 55 units A and 7 units B

(7: 55) = 0.127
0.127 * 100 = 12.7%

Re: Math problem... [Re: Oxy] #295386
10/24/09 22:12
10/24/09 22:12
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
right.. i know! but to calculate the min and max of 2 numbers .. thats the point

because if you have 90/120 and what if you have 120/90 that wont work, so it must know the min, and you dont want to out that, thepc should calculate from what you have..

So i forgot the mnual , there is that function min(a,b) lool so much work

Re: Math problem... [Re: MMike] #295391
10/24/09 22:37
10/24/09 22:37
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline
Expert
EvilSOB  Offline
Expert

Joined: Feb 2008
Posts: 3,232
Australia
Wouldnt this do what you are after?
result = minv(x,y) / maxv(x,y); as a 0.0->1.0 result
or
result = minv(x,y) / maxv(x,y) * 100; as a 0->100 (%) result


"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial
Re: Math problem... [Re: EvilSOB] #295401
10/25/09 00:13
10/25/09 00:13
Joined: Jul 2004
Posts: 1,710
MMike Offline OP
Serious User
MMike  Offline OP
Serious User

Joined: Jul 2004
Posts: 1,710
yes it would.. but i didnt know there was a minv :S lool other wise i would avoid that math stuff lol.. well but it was fun to go trough it lol

Re: Math problem... [Re: MMike] #295438
10/25/09 11:06
10/25/09 11:06
Joined: May 2008
Posts: 301
Oxy Offline
Senior Member
Oxy  Offline
Senior Member

Joined: May 2008
Posts: 301
come on, even of there where no min function,
you could use
if (a>b) max=a: min=b;
else max=b;min=a

you should be able to figure that out...

Page 2 of 2 1 2

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