Timestamps of M1 bars from IB

Posted By: Zheka

Timestamps of M1 bars from IB - 12/12/17 20:53

Quote:
In [Test] mode, bar generation is based on the UTC time stamps of the historical price data. For M1 data it is supposed that the time stamps indicate the end (not the start) of a tick....In [Trade] mode, bar generation is based on UTC time from the PC clock, not on the broker's server time

Zorro records historical M1 bars from IB with time stamps indicating start of a bar. Is this by design or a bug?
Timestamps in RT are end of bar.
Posted By: jcl

Re: Timestamps of M1 bars from IB - 12/13/17 07:34

I'm afraid you're right. This could be a bug. I'll forward it to the developer and if it is so, it will be fixed in the next update.
Posted By: Zheka

Re: Timestamps of M1 bars from IB - 01/04/18 22:04

JCL,
I have seen mention of changes to IB plugin in the "What's New" and thought the problem is fixed.
However, upon deleting/reloading the data with the updated plug-in, I still see the timestamps reflecting bar start.

Digging deeper, I found that even the EUR/USD data supplied with Zorro are also timestamped with the start of the M1 bar (See screen attached).
When aggregating M1 ticks into bigger bars, Zorro then correctly timestamps them, but this difference between raw data and aggregated is confusing.

Also, the price in the log for each bar shows Bar OPEN- which is very inconvenient and confusing when debugging.
Can this please be made consistent with timestamping and also reflect bar Close?

Attached picture Zorro_timestamps.PNG
Posted By: jcl

Re: Timestamps of M1 bars from IB - 01/05/18 09:09

AFAIK, all M1 data supplied with Zorro has bar end timestamps. The discrepancy might be due to rounding differences. Here's a simple script for printing time stamps and prices:

function run()
{
BarPeriod = 1;
set(LOGFILE);
printf("#n%.5f %.5f %.5f %.5f", priceOpen(), priceHigh(), priceLow(), priceClose());
}

The price in parentheses in the log is indeed the open, and the close would probably make more sense - we'll change that in a future version and will also look in the rounding issue. When you set Verbose to 3, it prints the open, high, low, and close.
Posted By: Zheka

Re: Timestamps of M1 bars from IB & Bar construction - 01/05/18 11:59

I just tested it with your script. Running it on M1, all is fine: timestamps do look to be end of bar and closes in the log coincide with raw data.

However, running the script with BarPeriod=5 shows there is a problem with larger bar construction (see attached).

Cockroach?

Attached picture Zorro_1min_bars.PNG
Attached picture Zorro_5min_bars.PNG
© 2024 lite-C Forums