Bug? Draw Line Block using time component for the price
-
Hi Dreema,
I believe there is a bug in the Draw Line block when drawing a trend line.
It may occur for other line types but I have not tested them.The problem is produced when using Market Properties -> Highest Price or Lowest Price (Time Period) -> Server Time for the price components.
The block is returning Local Time instead of Server Time when Server Time is requested.
The below link can be used to produce the "bug"
https://fxdreema.com/shared/XRrbApaYdTo produce the problem simply change your PC date and the line is redrawn to reflect the local PC time instead of server time.
Could you please have a look at this.
Thanks,
Allan. -
Nice observation
I think I fixed it -
Hi Dreema,
Thanks for the reply.
I made a new test EA and as far as I can tell it is still reading local time, not server time.https://fxdreema.com/shared/kT3LjTRUb
The old blocks are on the left and the new blocks are on the right.
This time the bug can be reproduced by changing the PC time, not the date.Cheers,
Allan. -
I will try to fix this tomorrow
-
I made some changes. It turned out to be tricky. I used one native function StringToTime() and I expected that it works with the server time, but no, it works with the local time. So I created another function that hopefully will work better, but who knows.
Also, the native GMT functions are also linked with the local time. -
Looks like you've nailed it Dreema.
Thanks!!!

By the way, by creating this builder and giving the ability for non-programmers to build EA's is absolutely wonderful.
Well done indeed!!