Back

Daily Consolidator on Exchange Hours

Hello,

I am trying to consolidate futures minute data to daily bars. Therefore I created a consolidator as follows:

var consolidator = new TradeBarConsolidator(TimeSpan.FromDays(1));

Unfortunately, this gives a bar starting from 11pm America/Chicago time --> + 1 day, which is the standard NY day, but which is not the exchange trading time. 

How to consolidate according to exchange trading hours?

e.g. pseudo code for Gold Futures "GC" trading from 5pm to 4pm Chicago time.

var consolidator = new TradeBarConsolidator(GC.MarketOpen, GC.MarketClose);

Thx.

Update Backtest







0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


I made some progress with the help of this post: Link, see Backtest.

The target is to generate daily bars from minute data according to exchange trading hours, not the standard QC NY 0am to 0am time. In my case for gold futures "GC".

Now, it works.... kind of. 

There are still issues with the implementation:

Lets focus on the Dezember 2020 contract Symbol=GC29Z20 

  1. The Open and Close data seems to be right for the 27th of August, but is wrong for other dates like e.g. the 26th August.
  2. The Volume on the 27th. August should be 461.99K, but is calculated to 453K
  3. Something strage happens when the Algo StartDate is changed from 25th August to the 20th August. It seems to have an influence on the Open, Close and Volume calculation of the 26th August:2020-08-26 18:01:00 :GC29Z20: GC XKR6JW5LEKKD: O: 1922.7 H: 1963.4 L: 1908.4 C: 1962.5 V: 277709or2020-08-26 18:01:00 :GC29Z20: GC XKR6JW5LEKKD: O: 1929.1 H: 1963.4 L: 1908.4 C: 1962.5 V: 306467Why is that?

 

Is there a fundamental issue of my implementation?

Thx.

Eugene

0


There was a small bug in the implementation. 

Furthermore, the volume in the data from algoseek seems to be slightly wrong for "some" minute bars (hundreds per day), which gives a slightly wrong daily volume.

For those who are interessted, see solution attached.

1


Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed