Back

Getting Higher Timeframe Indicator Values

Hi all, I'm facing some troubles running a hourly indicator on a lower time frame (1 min) and I hope someone would be able to clarify my doubts.

Let's say the time now is 03:39PM, when I call my_hourly_indicator.Current.Value within the OnData() method, is the hourly indicator value at 03:00PM being returned?

If so, is there any way to obtain the latest hourly indicator value based on most recent data at 03:39PM?

Thanks in advance for the help.

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.


Hi, You need to set 'Resolution.Minute' to get minute data. See the attachment. Hope it helps. Thanks.

0


Hi Malcolm

If you set up an indicator to use hourly data, it will be calculated every time the hourly data is feed to it, i.e. every hour. At 3:39 pm, the value at 3:00 pm is the latest value. The next value will be calculated at 4:00 pm.

Cheers, Tony

0

Hi Malcolm Tok 

Good question! I know of some graphic platforms that keep updating indicators and bars with the latest data available.

The answers from both ARam Kim and Tony Shacklock (thank you!) are right and complementary.
Let me fill the gaps.

When the algorithm has subscribed to hourly data, the hourly-resolution indicator will be updated when new data is streamed through the algorithm. On the other hand, if the algorithm has subscribed to higher-resolution data (minute, second or tick), the bars/ticks will be consolidating until they form an hourly bar. At this moment the hourly bar is consolidated, the indicator will be updated.

It means that there is no intermediate indicator value in Lean/QuantConnect.

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.


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