Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
5 registered members (AndrewAMD, Nymphodora, Quad, TipmyPip, Imhotep), 852 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 3 1 2 3
Re: Get a csv file into an array of structs, confused about lite-c [Re: easyX] #470959
02/14/18 12:39
02/14/18 12:39
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
I think I see now the problem. The timestamp has a "," between date and time, but the "," is a delimiter. That's why the parser does not work.

It should be relatively easy to fix that on the parser side. When you can wait for the next beta release, we'll include the fix there.



Re: Get a csv file into an array of structs, confused about lite-c [Re: jcl] #470961
02/14/18 12:56
02/14/18 12:56
Joined: Nov 2017
Posts: 39
Germany
E
easyX Offline OP
Newbie
easyX  Offline OP
Newbie
E

Joined: Nov 2017
Posts: 39
Germany
Ok great, thanks a lot.

Re: Get a csv file into an array of structs, confused about lite-c [Re: easyX] #471081
02/18/18 23:16
02/18/18 23:16
Joined: Nov 2017
Posts: 39
Germany
E
easyX Offline OP
Newbie
easyX  Offline OP
Newbie
E

Joined: Nov 2017
Posts: 39
Germany
Ok it is working now, also the download from Oanda, thank you very much!

Coming to another problem, i just realised that my external data for forex (asirikuy) is using GMT+1/+2 with european dst.

What are my options to work with this data? Can i parse it somehow and store the UTC times? Or do i have to set an offset in my scripts using this data?

Re: Get a csv file into an array of structs, confused about lite-c [Re: easyX] #471087
02/19/18 08:41
02/19/18 08:41
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Both is possible, but the normal way is converting it. It's a bit tricky because it has not a constant distance to UTC. For determining if a time T is DST or not, use

Now = T;
if(dst(NOW)) ...

Re: Get a csv file into an array of structs, confused about lite-c [Re: jcl] #471301
02/27/18 12:09
02/27/18 12:09
Joined: Nov 2017
Posts: 39
Germany
E
easyX Offline OP
Newbie
easyX  Offline OP
Newbie
E

Joined: Nov 2017
Posts: 39
Germany
Just to understand it, does Zorro uses timestamps of the historic data always as UTC? Could i work with offsets in this case? (1 or 2h depending on dst) to get the "real" UTC time from my data? Or is it best to convert it?

The problem seems to be be that the data back in old history is shifted even more, so somewhere between there was a change.

How long is a trade week? Always 5*24h (in forex) or did it change over the year(s)? If so it would be possible to find the shift (by looking at first and last bar of a week)

Re: Get a csv file into an array of structs, confused about lite-c [Re: easyX] #471343
02/28/18 14:24
02/28/18 14:24
Joined: Jul 2000
Posts: 27,977
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,977
Frankfurt
Yes, timestamps are supposed to be UTC. So you must correct them if they are local time. It does not matter much for daily data, but it matters for intraday data.

Re: Get a csv file into an array of structs, confused about lite-c [Re: easyX] #471361
03/01/18 05:59
03/01/18 05:59
Joined: Jan 2018
Posts: 29
L
luisd Offline
Newbie
luisd  Offline
Newbie
L

Joined: Jan 2018
Posts: 29
Originally Posted By: easyX
The problem seems to be be that the data back in old history is shifted even more, so somewhere between there was a change.

How long is a trade week? Always 5*24h (in forex) or did it change over the year(s)? If so it would be possible to find the shift (by looking at first and last bar of a week)


Use the CME forex futures trading hours for reference.
The CFD from FXCM and other brokers align to the CME hours
Forex hours use DST.

Re: Get a csv file into an array of structs, confused about lite-c [Re: luisd] #471367
03/01/18 11:16
03/01/18 11:16
Joined: Nov 2017
Posts: 39
Germany
E
easyX Offline OP
Newbie
easyX  Offline OP
Newbie
E

Joined: Nov 2017
Posts: 39
Germany
But how to get the historic trading hours of the CME forex future?

The problem is that not everywhere in the World they have DST (Japan) or it's slightly different (US compared to EU). So if you need to be sure where in the timeline you are ist very complex and a big mess.

As a simple example .. market open times of all different markets at any time at least since 2002.

First there was a rule change back in 2007 for US DST. Then Japan has no DST. Australia is on the southern hemisphere. So many factors you have to think of. I never found a working indicator e.g. in mt4 who tought about all this and had no mistakes! It seems Zorro so far has the most advanced DST handling.

But stil i somehow have to get my CET backtest data into UTC, even though the data seems not to be 100% consistent with timezone, i think older data is different. My idea is to analyse it week by week, checking if there is data for 5*24h, if so shift itthat it starts 23:00 sunday, but sometimes there is 1h missing, have to see if it's always the first after the weekend then it would be ok (but still not nice that it's missing).

Biggest problem for me is that i am still a big noob in c litec, handling with files for me is very difficult, never did that before at all.

Last edited by easyX; 03/01/18 11:17.
Re: Get a csv file into an array of structs, confused about lite-c [Re: easyX] #471431
03/03/18 17:37
03/03/18 17:37
Joined: Jan 2018
Posts: 29
L
luisd Offline
Newbie
luisd  Offline
Newbie
L

Joined: Jan 2018
Posts: 29
So you should use the Chicago DST.

That may not switch on and off in perfect sync with the CET DST. You are right here. That's the only point I have not verified.

To recap:
- if you want 'official' daily bars use the Futures FX opening time.

- best and simplest: download directly daily bars (already aggregated) from FXCM and use them as a separate time-series to work with your intraday bars.

- if you want to aggregate with Zorro, it's slightly more complex and the
results will not as perfect. Use CET 23H00 as the end of the day and aggregated with TimeFrame as shown in the example.

- usually around midnite CET volatility is low and differences are not huge.

Re: Get a csv file into an array of structs, confused about lite-c [Re: luisd] #471504
03/06/18 22:37
03/06/18 22:37
Joined: Nov 2017
Posts: 39
Germany
E
easyX Offline OP
Newbie
easyX  Offline OP
Newbie
E

Joined: Nov 2017
Posts: 39
Germany
Ok i figured out that my Data is 100% GMT+1/+2 (central european time)

This was made sure by checking for the regular NFP news, it's easy to find/visible and always at the same time.

So now knowing this i want to convert my data to UTC for Zorro.

How can i add/subtract 1 hour from a time? I also don't really understand Now and NOW why do i need this? can't find any examples how to use this.. frown (i need clear examples to understand/copy something i haven't done yet, even though its basic)

Page 2 of 3 1 2 3

Moderated by  Petra 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1