Back

Release: Zoned Time Of Day QuoteBar Consolidator

Hi,

Doggie52/Lean-Zoned-Time-Of-Day-Consolidator

I have been working on a quotebar consolidator that consolidates bars once a day at a specific time in a specific timezone.

Usage:

  • Set your data resolution to at least Resolution.Hour. If your time of day has a minute-component, you will need Resolution.Minute. Same if your time of day has a second-component (Resolution.Second).
  • Example: Consolidate bars at 3AM London time every day:
MyConsolidator = new ZonedTimeOfDayQuoteBarConsolidator(
dailyCloseTime: TimeSpan.FromHours( 3 ),
closeTimeZone: "Europe/London",
exchangeTimeZone: security.Exchange.TimeZone.ToString()
);

I have tested this in backtests and am currently using it on my live deployment without issues.

Hopefully some of you find this useful. Submit issues and PRs in the repository linked if you have suggestions or comments.

Doggie52/Lean-Zoned-Time-Of-Day-Consolidator

Thanks!

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.


To achieve a similar goal, you can use Alex's approach of manually closing and resetting the consolidator but I'd like to think my solution is a bit more intuitive and more flexible as it can be easily used inside Alphas (just replace your current consolidator code).

0

Thank you very much for this nice piece of work.

0

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