Back

How to subscribe to Tick.Resolution AND have OnData called every sec with forward filled 1 sec trade bars?


Any ideas how to achieve above?

Problem so far: My default algo subscribes to multiple cryptos at Resolution.Second. It's desired that OnData is called every second because predictions are carried out and ~100 indicators updated.

But when subscribing all securities to Resolution.Tick and creating 1 sec consolidators, the conslidated data handlers are called at somewhat arbitrary time intervals. Please let me know if this shouldn't be the case, assuming now that's okay based on Jared' comment "Tick data doesn't fill forward as there is no time period for a tick; its a spot value." . Is there a flag to set? Happy to provide some code otherwise

Again, can I still get Data Slice every second forward filled while subscribed to Tick? Think I cannot subscribe to both (Tick, Second) and currently considering taking Tick handling into the Brokerage class (tricky with referencing.) or even running a separate process.

Thanks for any hints, Sebastian

Update Backtest







As Jared suggested, there is no time period for a tick its a spot value. Tick data can not fill forward. The number of ticks in one second is non-deterministic. OnData() should be called every second and you'll get a list of ticks within one second in the bar data. If there's not tick data in a second, OnData() won't get called. Same thing for the second data consolidator. If there's no tick, the consolidated handler method won't get called.

There is a boolean argument in AddCrypto to control the data fill forward

AddCrypto(ticker, resolution, market, fillDataForward, leverage)
# for example the second resolution
self.AddCrypto("BTCUSD", Resolution.Second, Market.GDAX, True)

Setting the fillDataForward to be true in Tick resolution doesn't take effect. 

1

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.


Thank you Jing. Helpful to read the ff is off with ticks and the consolidator is not called without a tick coming in. I have refactored to requesting Second Resolution in the QC.Algorithm and handle the small use case for ticks in the Brokerage class.

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