Back

Consolidator timing and warming up indicators

I've noticed discrepencies with my consolidators such that for markets which open @ 9:30am and close @ 4pm; FWIW my resolution is minute, but I don't think this issue stems from that. This issue is messing up the timing of my trades in a significant way:

  • 1m, 5m, 15m, 30m: no issues as they always run when needed
  • 1hr: updates @ 10am, 11am instead of 9:30am, 10:30am, 11:30am, etc.
  • 4hr: updates @ 12pm, 4pm instead of @ 9:30am, 1:30pm
  • 1D: not an issue
  • 1W: updates mid-week and may even change due to holidays instead of encompassing Mon - Fri
  • 1M: does not encompass entire month (months don't all have same # of days)

I had the thought of rolling my own custom consolidators, but I came across this issue. Am I stuck waiting for a solution on this? I'm coding in Python.

---

I thought that setting a WarmUp period in the algorithm would update my indicators automatically. It turns out this is not the case; I've managed to find a solution on this forum and elsewhere for that but I think this is an unnecessary setup and clutters up my algo. Does this pull request seek to solve that issue?

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.


Hi,

I believe your issue is similar to one I've faced and raised a GH issue for. I don't think the PR you've linked would solve that but I'm happy to be corrected.

Feel free to take a look at my custom consolidator. It tries to solve the specific issue where a 1-day bar will be built and consolidated at inconsistent times based on the timezone of the exchange of the security. It's built in C# though, I'm not sure if you can mix Python and C# in the web terminal. On a local Lean installation it's fine of course.

0

QC did some changes on weekly and monthly ive seen on github:

https://github.com/QuantConnect/Lean/issues/3007

maybe needs to get to production

the rest: 1 & 2 & 3 & 4 & 5 hour candle would need to get implemented by yourself

taking data from the period and checked for closed high lows and open of the window

 

0

After doing some more digging in the pull requests, it seems that they've been added to master (without public documentation, likely coming soon...). I was able to set the weekly and monthly timeframes accurately by using CalendarType.Weekly and CalendarType.Monthly respectively instead of using timedelta when creating my consolidators. I haven't yet looked into timeframes < 1 day to fix the 9:30am start time issue but I wanted to let everyone know there was a working solution to the higher timeframe issues.

---

Regarding the warmup issue, there was an accepted pull request that implements WarmUpIndicator, however I have yet to get it to work ("...ensure each parameter type matches those required by the WarmUpIndicator method"). Without public documentation I may not be able to get this to work.

0

Appreciate the eagerness! Please be patient as it takes time to write the

docs for brand new unreleased tech :)
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.


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