Hi,
I don't have a question these time, but just an observation . It's about consolidators.
I am not sure if it is only one, but these is one of very few features I am struggling with in QC.
Very often I first develop algo on Hour resolution to check if everything work properly. Than I almost always I want to see how the algo behaves on lower frequency.
But for me it is very complicated to go from say, an hour resolution to 30 minute ''resolution''.
I know I have to use consolidators, but to use them I have to make lot's of changes to my existing code and spend hours to figure out how to do that. So, to change only one variable in the function (hour to 30 minutes), I have to go through all the code from beginning to the end and make several changes.
For example, I have to:
1. Define consolidators for every symbol in universe. If you look at examples on the community you will see different approaches. Some add consolidators in the init (
), some make it in OnSecuritiesChanged method, some make it in Symbol data class, some make it in OnData part. There is no clear rule where to make consolidators.
2. Than you have to make sure you remove consolidators when the symbol remove universe.
3. than, if you used self.History to warm up your window, it doesn't work anymore with consolidators. You have to change your code and use something like:
history = self.History([self.symbol], self.lookback * 5, self.resolution)
for time, bar in history.loc[self.symbol].iterrows():
tradeBar = TradeBar(time, self.symbol, bar.open, bar.high,
bar.low, bar.close, bar.volume,
timedelta(minutes=1))
consolidator.Update(tradeBar)
which is not in documentation but you have to find it somewhere in the community.
4. Than you have to take care that you do actions on OnData part only when new consolidated bar become available.
...
In the end, I need completely new project to just use 30 minutes instead of 60 minutes :)
I was using backtrader before and I remember I just had to add one function to use lower frequencies (it was resample function). I know consolidators are more abstract, but very often we don't need complicated series with different resolutions but just 5 minute bars instead of 1 minute bars.
It would be great if you could somehow make transformation from hour Resolution to lower frequencies easier.
Alexandre Catarino
Hi Mislav Sagovac ,
Thank you for the suggestion.
We have created a GitHub issue that might address part if not all, of the suggestion:
Adds Securities With Custom Period #5322
Mislav Sagovac
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 unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!