Historical ticks for Lookback backfill

Posted By: Zheka

Historical ticks for Lookback backfill - 07/02/20 16:42

After observing some weirdness in backfilling LookBack data from MT4, I found out that Zorro does not always request M1 bars.

For BarPeriod=60 it requests 15min bars, for BarPeriod = 30 - 5min bars.

This does not work if BarOffset is set (which I believe was the reason to request M1 bars by default).

This is since v 2.28.xx....probably also 2.27.xx...earlier versions requested PERIOD_M1 historical candles from MT4.

Posted By: Zheka

Re: Historical ticks for Lookback backfill - 07/03/20 17:19

I have backchecked Zorro releases till 2.20 - and, indeed, for BarPeriod=60 15-min historical candles are requested from the broker, both for MT4 and IB.

This means that with BarOffset=8 and BarPeriod=60, the open-close of such hourly candles in Lookback will actually be from 8 minutes earlier (since Zorro will use a xx:00 - xx:15 candle as the last 'tick' in construction of a 60-min candle).

It becomes a nightmare to reconcile/ verify live trading performance with 're-test' for an MT4-trading system that uses historical ASK data from e.g. IB for PRELOAD, backfills BIDs from MT4 for Lookback - shifted by BarOffset,
then continues with Asks from MT4 in live.

IS there really a problem with requesting M1 ticks for Lookback? both IB and MT (at least Darwinex and Alpari) handle such requests - even voluminous - easily..


Can BarOffset ( !=0) be a flag that would switch lookback backfill requests to M1 ticks?



Posted By: jcl

Re: Historical ticks for Lookback backfill - 07/06/20 09:48

The lookback is filled at higher resolution than one bar period, but certainly not with M1 ticks. That would cause a very slow start on long lookback periods.

I would not trade a system that is so sensitive on BarOffset that even the lookback period needs M1 ticks. But if you really need them for some reason, load them with assetHistory and PRELOAD.
Posted By: Zheka

Re: Historical ticks for Lookback backfill - 07/06/20 11:36

Long lookback periods causing very slow starts should use PRELOAD. But a strategy that has to be restarted after 3-4 days for some emergency reason should not fall victim of the "lowest common denominator'.

M1 ticks are needed not because BarOffset is critical for the system, but so that live and re-test performance are consistent and can be verified easily (especially in the initial period where a system is being fine-tuned before getting its full size).

Practically:

1) with BarOffset and data for half of Lookback period existing in a historical file, how will Zorro create candles for the Lookback?

Half - at exact bar periods (i.e. respecting BarOffset) - and the most recent half - with whatever is downloaded from the broker (not respecting BarOffset)?

2) Can a new flag/ variable pls be added that would force lookback backfill at the desired resolution?


Thank you!
Posted By: jcl

Re: Historical ticks for Lookback backfill - 07/07/20 07:04

A candle begins at bar start plus bar offset and has the width of one bar period. A variable for setting the lookback resolution is possibly easy to implement - I'll put that on my list to check.
Posted By: Zheka

Re: Historical ticks for Lookback backfill - 07/07/20 09:11

Originally Posted by jcl
A candle begins at bar start plus bar offset and has the width of one bar period.
This is if historical 'ticks' are granular enough and exist with timestamps at BarOffset.

But M15 bars loaded from brokers are for regular periods (xx:00-xx:15, etc).

If 1/2 of the long Lookback period exists in a historical file and is PRELOADed, and 1/2 has to be completed from a broker - how will Zorro create (BarPeriod=60; BarOffset=6) candles for the Lookback ?

Posted By: jcl

Re: Historical ticks for Lookback backfill - 07/07/20 13:32

You seem to assume that bars are different dependent on preload or on granularity in the lookback period. That is not so.

How bars and candles are created is described at length in the manual: https://manual.zorro-project.com/bars.htm. It's the same for all data resolutions.
Posted By: Zheka

Re: Historical ticks for Lookback backfill - 07/08/20 09:10


Originally Posted by jcl
You seem to assume that bars are different dependent on preload or on granularity in the lookback period.
No, I don't.

I am trying to find out how will Zorro create candles (= establish O-H-L-C prices) for the bars in the following situation:

BarOffset=6;
BarPeriod =60; // so, bars have timestamps of xx:06

LookBack=240; // 10 days

EndDate = 20200807;

set(PRELOAD);

Historical data in a t6 file (M1) exist until 2020-06-07 22:00 UTC.

Zorro will request/obtain M15 'ticks' from the broker to backfill missing recent data for the Lookback:

- 22:00 , 22:15, 22:30, 22:45, 23:00, 23:15....


What will be the O-H-L-C prices of the bars 2020-06-07 22:06 and 23:06...?
Posted By: Zheka

Re: Historical ticks for Lookback backfill - 07/22/20 00:02

bump..
Posted By: jcl

Re: Historical ticks for Lookback backfill - 07/22/20 08:26

Hmm. It's in all details on the page that I linked. The manual is your friend - just read it.
Posted By: Zheka

Re: Historical ticks for Lookback backfill - 07/22/20 11:28

Originally Posted by jcl
A variable for setting the lookback resolution is possibly easy to implement - I'll put that on my list to check.
Would be great to get this added.
© 2024 lite-C Forums