|
Calculating dynamic price ranges |
hfc
|
Post subject: Calculating dynamic price ranges |
Post rating: 0
|
Posted: Tue 26 Apr, 2016, 18:45
|
|
User rating: 0
Joined: Tue 12 Apr, 2016, 06:51 Posts: 11 Location: CanadaCanada
|
Hi there,
I am trying to do the following calculate a range for price and store into a variable like follows:
if price is between 1.xx50-1.xx60 then action
and
if price is between 1.xx40-1.xx50 then action
how do I calculate that in visual jforex?
|
|
|
|
 |
amine_chourou
|
Post subject: Re: Calculating dynamic price ranges |
Post rating: 0
|
Posted: Wed 27 Apr, 2016, 08:59
|
|
Visual JForex expert at Dukascopy |  |
User rating: 288
Joined: Thu 18 Apr, 2013, 09:26 Posts: 1496 Location: Switzerland, Geneva
|
Hi,
You must use a trick to to that: First you need to get the first 2 decimals and keep them for the next use ( x.yz40 etc ...), So the idea is to use calculation expression block to get the first "x.yz" number using a result that is defined as "integer" type because such variable type will disregard decimals. (1.12345 --> if set to integer will be --> 1) and then 100 that you see in the first calculation (A1/100/A2 is used to truncate and get the xyz in question. Finally, you add your 0.0040 / 0.0050 / 0.0060 to the result.
Attachments: |
Custom_truncate.vfs [21.85 KiB]
Downloaded 132 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.
|
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|