Back

Hourly and Minutely Equivalent of Daily Data for Indicators

Hi all,

This might be a trivial question but I didn't find much info on it. I was wondering if someone could help with this,

Let's say I want to find the max of 8 days in minutely or hourly resolution using the MAX indicator.

I know that for a daily resolution:

daily = self.MAX(symbol, 8, Resolution.Daily)

What happens for hourly? Is it 24 hours for one day? Like this: Hourly = self.MAX(symbol, 8*24 , Resolution.Hour)

which would render, minutely = self.MAX(symbol, 8*24*60  , Resolution.Hour) ?

The reason for that is that I want the indicator to capture the most recent surge or drop in stock as well. Correct me if I am wrong, but using a daily resolution does not seem to account for today's changes.

Thanks,

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.


Hey Amine,

Indicators are only updated with data during market open hours, unless you specify the algorithm to use extended hours data. This means there are 6.5 hours of trading per day or 390 minutes of trading per day.

To get the maximum of the past 8 days of hour resolution data, you should round up and use 7 hours per day across 8 days.

Hourly = self.Max(symbol, 7 * 8, Resolution.Hour)

For the maximum of the past 8 days of minute resolution data, there are 390 minutes per day across 8 days.

Minutely = self.Max(symbol, 390 * 8, Resolution.Minute)

 

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