Dukascopy
 
 
Wiki JStore Search Login

Enhancement request for adding round function to Calculation Expression.
 Post subject: Enhancement request for adding round function to Calculation Expression. Post rating: 0   New post Posted: Tue 15 Sep, 2015, 22:19 
User avatar

User rating: 0
Joined: Sun 01 Feb, 2015, 22:49
Posts: 81
Location: RomaniaRomania
Hi,

I had many situations when I needed to cast / round a double variable to an int.
Could you add round function to Calculation Expression?

P.S.
I observed that dividing a double variable by an int variable casts it automatically to an int. This is not default Java behavior. This only happens in the JForex Tester, not in the Visual Tester.
This made my entry prices go mad. Example values 0, 1 or 2.

Regards,
mosu_d


 
 Post subject: Re: Enhancement request for adding round function to Calculation Expression. Post rating: 0   New post Posted: Wed 16 Sep, 2015, 10:47 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

I think this is partially replied in your previous post. For rounding matters, you need 2 blocks:
https://www.dukascopy.com/swiss/english ... 40&t=53122

Generally speaking if you need to eliminate all decimals from a Double variable, you can use the Assign block: you'll have 1.12325 assigned to an integer and the value will be 1. Same for any double variable.

Cheers


 
 Post subject: Re: Enhancement request for adding round function to Calculation Expression. Post rating: 0   New post Posted: Thu 17 Sep, 2015, 13:03 
User avatar

User rating: 0
Joined: Sun 01 Feb, 2015, 22:49
Posts: 81
Location: RomaniaRomania
Hi Amine,

The solution you gave in ROUNDING_3 is very ingenious for dropping the trailing (last) X digits.
But it does not act like a round, but a trunc.

Example
Image

For double 111.568 the round value should be 112 integer.

Regarding my initial P.S.
If double 111.568 is calculated like this, and used in a position,
it will take value 111 in JForex tester. This is a real pain/bug.

Regards,
mosu_d


Attachments:
Untitled.png [41.3 KiB]
Downloaded 351 times
ROUNDING_3.vfs [19.09 KiB]
Downloaded 193 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.
 
 Post subject: Re: Enhancement request for adding round function to Calculation Expression. Post rating: 0   New post Posted: Thu 01 Oct, 2015, 10:38 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
I see,
in this case we may need to assess that and get back to you

Thanks for your patience !


 
 Post subject: Re: Enhancement request for adding round function to Calculation Expression. Post rating: 0   New post Posted: Sat 17 Oct, 2015, 13:57 
User avatar

User rating: 0
Joined: Sun 01 Feb, 2015, 22:49
Posts: 81
Location: RomaniaRomania
Hi,

After updating Visual Forex platform, the following block stops the entire strategy without any errors:

Image

Where loopCounter is an Integer and Comment is a String.

It worked in the previous version of Visual Forex and
the strategy still works if tested in JForex Historical Tester.

Regards,
mosu_d


Attachments:
Untitled.png [12.03 KiB]
Downloaded 351 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.
 
 Post subject: Re: Enhancement request for adding round function to Calculation Expression. Post rating: 0   New post Posted: Mon 19 Oct, 2015, 08:21 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi;

Thanks for reporting this issue. If it is related to the fact of inactive calculation block when you open the strategy (Red header instead of green) then this issue is currently handled and will be fixed asap. If it is another issue then please send your strategy in vfs format.

Cheers !


 
 Post subject: Re: Enhancement request for adding round function to Calculation Expression. Post rating: 0   New post Posted: Thu 07 Jan, 2016, 22:54 
User avatar

User rating: 0
Joined: Sun 01 Feb, 2015, 22:49
Posts: 81
Location: RomaniaRomania
Hi there,

Any news for adding round function?

Thank you,
mosu_d


 
 Post subject: Re: Enhancement request for adding round function to Calculation Expression. Post rating: 0   New post Posted: Mon 11 Jan, 2016, 14:38 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

Round function in VJF is unfortunately not planned as an enhancement due to the outstanding issues and new functionalities to be implemented.
How important is this for your strategy ? the trunk idea doesn't help at all ? alternatively, can you change your code manually to insert this function ?

Thanks


 

Jump to:  

cron
  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com