LEAN is the open source
algorithmic trading engine powering QuantConnect. Founded in 2013 LEAN has been built by a
global community of 80+ engineers and powers more than a dozen hedge funds today.
Alpha League Competition: $1,000 Weekly Prize Pool
Qualifying Alpha Streams Reentered Weekly Learn
more
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.
var oneMinuteConsolidator = new TradeBarConsolidator(TimeSpan.FromMinutes(1));
oneMinuteConsolidator.DataConsolidated += OneMinuteConsolidator_DataConsolidated;
SubscriptionManager.AddConsolidator(Symbol, oneMinuteConsolidator);
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.
Michael Handschuh
50.5k
,
Instead of TradeBarConsolidator use the TickConsolidator since your input stream is ticks. Let me know if this doesn't fix the issue!
0
Jianwei Wang
870
,
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
Jianwei Wang
870
,
Apologies, please ignore the lag question, the event is triggered at the correct time.
Any suggestion on getting the current OHLC bar?
0
Michael Handschuh
50.5k
,
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.
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...
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!