Back

How to get minute bar while registering per tick data

Hi Team,

I tried two methods to get consolidated OHLC bar from tick data:
1. Identity: it only returns BaseData with close price only.
2. Consolidator: it throws warning saying type mismatch found between consolidator and symbol.
Thank you.


AddSecurity(SecurityType.Forex, Symbol, Resolution.Tick);

MinuteIdentity = Identity(Symbol, Resolution.Minute);
MinuteIdentity.Updated += MinuteIdentity_Updated;

var oneMinuteConsolidator = new TradeBarConsolidator(TimeSpan.FromMinutes(1));
oneMinuteConsolidator.DataConsolidated += OneMinuteConsolidator_DataConsolidated;
SubscriptionManager.AddConsolidator(Symbol, oneMinuteConsolidator);
Update Backtest








Instead of TradeBarConsolidator use the TickConsolidator since your input stream is ticks. Let me know if this doesn't fix the issue!
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.


Thanks Michael. I should have discovered that earlier.
Just one thing I notice is that there is a one interval lag between the current tick data and the one minute consolidator event been called.
Let's say the consolidator event for bar (01:00:00 - 01:01:00) would be triggered at 01:02:00, instead of 01:01:00. Seems to have a lag, is it the expected behavior?
Also is there a easy way to get the current OHLC bar, while subscribing to per tick data?
Thx.
1

Apologies, please ignore the lag question, the event is triggered at the correct time.
Any suggestion on getting the current OHLC bar?
0

If you're subscribed to Tick data and want OHLC bars, you'll need to use a consolidator. Do you mean you want the working bar, because consolidator's also have a WorkingBar property.
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.


Go to yahoo
0

Thanks Michael. I get what I want from WorkingBar!
0

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