My Forex strategies work on days that close when the New York markets close at 17:00 New York time, but the data comes with daily roll-overs either at 00:00 UTC (19:00 EST) or 00:00 EST.
I'd like to create a custom consolidator to make QuoteBars every day at 17:00 New York time.
I've tried the approach suggested in this post, but there are things missing.
- It doesn't build when I wire the custom consolidator to my data handler,
- I guessed what WorkingData should get.
- I don't know what Scan() should do.
I'd appreciate any suggestions.
I thought an alternative would be to clone and modify the QuoteBarConsolidator class. Can I get that somewhere?
Tony Shacklock
I have created TimeOfDayConsolidator and QuoteBarTimeOfDayConsolidator classes - cloned and modified from PeriodCountConsolidatorBase and QuoteBarConsolidator classes.
I feel a bit out of my depth, so I'd appreciate someone looking over them to see if I've got it right. They test out fine with Oanda and FXCM data, but there are probably situations that I haven't accounted for.
Any comments appreciated.
Second question: I've created the two consolidator classes in separate files. How to I make them available to other projects in the Web IDE?
Â
Â
Jack Simonson
This looks great Tony, it's definitely something you would want to make available across multiple algorithms. You can create custom libraries in the Algorithm Lab and access those from different algorithms. If you look at the side-bar in the terminal, there is a section beneath the files in your current project where you can create custom libraries. Just click the "Add New Library" button! You can also see the answer to a similar question that was posted here.
Tony Shacklock
Thanks, Jack.
The link to the similar question doesn't work for me. Would you post it again, please?
Cheers
Tony
Jack Simonson
Try clicking this link. Hopefully, this one works.
Douglas Stridsberg
This is useful - however I'd like to point one thing. The documentation mentions the passing of a specified time of day in the data timezone. In reality, it references the exchange timezone. One example is Oanda forex where passing TimeSpan.FromHours(0) to the consolidator gives bars closing at midnight New York (exchange) rather than midnight UTC (data).
Tony Shacklock
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!