Hello. In one example I was working with tick data. I set the resolution to tick. As far as I thought, we should have a single event in every tick that enters OnData. But why the following code was used to check the data. That is, how many ticks may we have in each tick event? And for this reason, for has been used.
def OnData(self, data):
if not data.ContainsKey(self.symbol):
return
for tick in data.Ticks[self.symbol]:
if tick.TickType == TickType.Trade:
self.trade_ticks.append(1)
self.quote_ticks.append(0)
if tick.TickType == TickType.Quote:
self.trade_ticks.append(0)
self.quote_ticks.append(1)
Best,
lob.Faidi
Derek Melchin
Hi LOB faridi,
Ticks are grouped together if they have the same timestamp. Some data doesn't have a timestamp with resolution higher than 0.001 seconds, so they are emitted together. See the attached backtest for reference.
Best,
Derek Melchin
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.
R.mat faridi
Hi Derek
Thanks for your explanation about Tick Data and attached backtest
As well as other additional points that you mentioned in the attached backtest
Best,
lob.Faidi
R.mat faridi
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!