Dukascopy
 
 
Wiki JStore Search Login

Calculating the hours between some candle and now.
 Post subject: Calculating the hours between some candle and now. Post rating: 0   New post Posted: Thu 10 Sep, 2015, 20:23 
User avatar

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

I have the strategy attached Default_1.12
Image

1. Calculating the time between last hourly candle and Get Historical Candle with shift 0 should be 0 not -1.
2. Using Last Tick Time instead of last Candle time gives results between 0 and -8.0008797... something

Regards,
mosu_d


Attachments:
Time difference.png [29.85 KiB]
Downloaded 405 times
Default_1.12.vfs [21.23 KiB]
Downloaded 123 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: Calculating the hours between some candle and now. Post rating: 0   New post Posted: Fri 11 Sep, 2015, 14:25 
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 your post.
Basically the result should be indeed 0 but troubleshooting the problem more deeply it appears that the time stamp of both variable is correct but there is some lag time in the update of the time variable related to the historical candle. As far As I seen the delay is not consequent as the variable gets updated with the correct time less than a second BUT after the calculation is already performed with the wrong result.
I think that this is not really blocking, can you provide some description about the idea behind that ? maybe we can figure out another way around ..

We'll address this meanwhile ..

Cheers


 
 Post subject: Re: Calculating the hours between some candle and now. Post rating: 0   New post Posted: Tue 15 Sep, 2015, 20:40 
User avatar

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

For report 1
Yes, I also observed the same with regards to the first point.
I discovered this while working on a solution for a custom SandR with blocks for thread (S&R indicator in Visual JF?).

I can work around it now that I know the problem. Simplest solution would be thread:
Enhancement request for adding round function to Calculation Expression.


For report 2
For this I have no clue because the results are all over the place.

Cheers,
mosu_d


 
 Post subject: Re: Calculating the hours between some candle and now. Post rating: 0   New post Posted: Wed 16 Sep, 2015, 10:43 
Visual JForex expert at Dukascopy
User avatar

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

1/ Check the attached example for the rounding issue.
2/
Quote:
Using Last Tick Time instead of last Candle time gives results between 0 and -8.0008797... something

Can you provide the calculation block so that I can understand exactly what are you trying to do ?


Thanks


Attachments:
ROUNDING_3.vfs [19.09 KiB]
Downloaded 136 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: Calculating the hours between some candle and now. Post rating: 0   New post Posted: Thu 17 Sep, 2015, 13:24 
User avatar

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

Regarding point 2,
strategy Default_1.12_tick.


There may be some other problem other than just some milliseconds.
If the test is executed with DefaultPeriod 4H instead of 1H, the result is -4 instead of -1.


Issue 3
Getting the candle time on 4H and 1D returns incorrect values: Default_1.13

Regards,
mosu_d


Attachments:
Default_1.13.vfs [26.04 KiB]
Downloaded 122 times
Default_1.12_tick.vfs [21.21 KiB]
Downloaded 124 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.
 

Jump to:  

  © 1998-2024 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