Currently we only support minute data,
Is there any way for us to downsample Index Option data to 1 hour or 1 day?
Currently we only support minute data,
Is there any way for us to downsample Index Option data to 1 hour or 1 day?
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 Jay
We recommend using a consolidator to do so. Please read through this doc for its usage. Note that you'll need one for each security, so it would be the best practice to manage it in OnSecuritiesChanged method for a dynamic universe. Also, OnData method would still run once every minute of receiving data, so you'll have to use a consolidation handler for action upon the bar consolidated.
def Initialize(self):
self.consolidatorDict = {}
def OnSecuritiesChanged(self, changes):
for security in changes.AddedSecurities:
if security.Type == SecurityType.IndexOption:
symbol = security.Symbol
self.consolidatorDict[symbol] = TradeBarConsolidator(timedelta(days=1))
self.consolidatorDict[symbol].DataConsolidated += self.ConsolidationHandler
self.SubscriptionManager.AddConsolidator(symbol, self.consolidatorDict[symbol])
for security in changes.RemovedSecurities:
symbol = security.Symbol
if symbol in self.consolidatorDict:
consolidator = self.consolidatorDict.pop(symbol)
self.SubscriptionManager.RemoveConsolidator(symbol, consolidator)
def ConsolidationHandler(self, sender, consolidated):
# Action upon daily bar finished
# consolidated will be a TradeBar object
if consolidated.Close > consolidated.Open:
self.MarketOrder(consolidated.Symbol, 1)
Best
Louis
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.
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!