How to round numbers?
yogurt
Post subject: How to round numbers?
Post rating: 0
Posted: Mon 22 Jul, 2013, 01:10
User rating: 1
Joined: Tue 11 Jun, 2013, 15:40Posts: 29Location: Russian FederationRussian Federation
I want that lot amount at my market order depends on equity. For example 0.1 lot per 10000 equity. I tried to do that, but it gives an error. I think it is because it can`t place the order with 0.543568748 amount. Please help.
Bruno_Grunberg
Post subject: Re: How to round numbers?
Post rating: 0
Posted: Mon 22 Jul, 2013, 07:16
Site Administrator
User rating: ∞
Joined: Fri 21 Jun, 2013, 16:50Posts: 197Location: FranceFrance
The mistake might be somewhere else.
In this video:
what you are trying to do is explained step by step.
dirk_r1
Post subject: Re: How to round numbers?
Post rating: 0
Posted: Mon 22 Jul, 2013, 08:13
Visual JForex expert at Dukascopy
User rating: 27
Joined: Fri 03 May, 2013, 18:25Posts: 366Location: GermanyGermany
Hello!
in your case it would be like this setup:
Happy trading!
Attachments:
LOT_Size.png [46.41 KiB]
Downloaded 814 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on
this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control
on their content. Anyone accessing this webpage and downloading or otherwise making use of any document,
data or information found on this webpage shall do it on his/her own risks without any recourse against
Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from
the use and/or reliance on any document, data or information found on this webpage.
yogurt
Post subject: Re: How to round numbers?
Post rating: 0
Posted: Mon 22 Jul, 2013, 17:04
User rating: 1
Joined: Tue 11 Jun, 2013, 15:40Posts: 29Location: Russian FederationRussian Federation
Thank you.
Will try this.
But how to round numbers?
dirk_r1
Post subject: Re: How to round numbers?
Post rating: 0
Posted: Mon 22 Jul, 2013, 17:34
Visual JForex expert at Dukascopy
User rating: 27
Joined: Fri 03 May, 2013, 18:25Posts: 366Location: GermanyGermany
My question is: why do you need this? VJF takes any value you want and you can calculate with them. Otherwise, if you still need to round numbers i am afraid that you cannot do this. But maybe the community knows better than myself?
yogurt
Post subject: Re: How to round numbers?
Post rating: 0
Posted: Mon 22 Jul, 2013, 21:45
User rating: 1
Joined: Tue 11 Jun, 2013, 15:40Posts: 29Location: Russian FederationRussian Federation
dirk_r1 wrote:
My question is: why do you need this? VJF takes any value you want and you can calculate with them. Otherwise, if you still need to round numbers i am afraid that you cannot do this. But maybe the community knows better than myself?
For example, I would like that any lot amount will be calculated automatically depends of equity and looks like X.X77 or X.X55
I have some thoughts about it:
Quote:
The Integer - it is a number, with data 32-bit. It has a minimum value of -2,147,483,648 and a maximum value of 2,147,483,647 (inclusive).
So if I use this type of data and multiply it by 1 000 000 000 and then divide it by 1 000 000 000, will it be rounded in this case?
dirk_r1
Post subject: Re: How to round numbers?
Post rating: 0
Posted: Tue 23 Jul, 2013, 10:16
Visual JForex expert at Dukascopy
User rating: 27
Joined: Fri 03 May, 2013, 18:25Posts: 366Location: GermanyGermany
Unfortunately, rounding numbers is not possible yet. I double checked with the developers and they assured me that it would be fixed (available) soon.
Quote:
The Integer - it is a number, with data 32-bit.
It has a minimum value of -2,147,483,648 and a maximum value of 2,147,483,647 (inclusive).
So if I use this type of data and multiply it by 1 000 000 000 and then divide it by 1 000 000 000, will it be rounded in this case?
The problem is that there would be an error if you try to do that in this way, cause the integer type does not take any commas.
I will turn back to you when the problem is fixed.
yogurt
Post subject: Re: How to round numbers?
Post rating: 0
Posted: Tue 23 Jul, 2013, 14:47
User rating: 1
Joined: Tue 11 Jun, 2013, 15:40Posts: 29Location: Russian FederationRussian Federation
orossard
Post subject: Re: How to round numbers?
Post rating: 1
Posted: Thu 14 Aug, 2014, 09:00
User rating: 1
Joined: Sat 09 Aug, 2014, 10:46Posts: 1Location: France, St Laurent du Var
Dirty way to round a number is to transfert the content of a double into an int variable, that's the only way I could find so far in visual jforex but it work fine
Pages: [
1
]