Using the information from Reading data from Dukascopy tick binary file I've implemented my own Dukas tick data feed download library in C#.
The above link confirms the data is stored in big endian format, and must be converted. The final answer on the above link also indicates the format of the file is as follows:
int1 is seconds within this hour (this should actually be milliseconds)
int2 is Ask * 10000
int3 is Bid * 10000
float1 is Ask Volume
float2 is Bid Volume
I'm using the following code snippet to read the values from the downloaded and uncompressed binary data:
int hourMs = IPAddress.HostToNetworkOrder(br.ReadInt32());
double ask = IPAddress.HostToNetworkOrder(br.ReadInt32()) / 10000.0;
double bid = IPAddress.HostToNetworkOrder(br.ReadInt32()) / 10000.0;
br.ReadSingle(); // ask vol - don't need
br.ReadSingle(); // bid vol - don't need
Using TickStory, I've downloaded tick data for the equivalent symbols and dates, and confirmed the tick millisecond values are correct.
However, the bid/ask prices are wrong by an order of magnitude. From some quick checks, any JPY cross pair (and also gold) prices are an order of magnitude too low, and any other pairs are an order of magnitude too high. When corrected manually, they match perfectly to the prices I downloaded from TickStory.
Now, I could simply change the divisor above to 100,000 and use 1,000 instead as a special case for JPY crosses/gold - but this is just a bodge, and I'm sure it's not necessary.
Is there something I'm getting wrong, in either the format, or the endian conversion?
Thanks