I'm a bit puzzled. If you take a look at the project 'QCU/ Strategy Example: Moving Average Cross Strategy', you will see that the SPY is registered for a minute resolution. However in the OnData we check if it is a new day and only execute once per day. I assume this is the first minute of the day. EMA values are based on daily values. So, will the EMA value accessible on the first minute of the day be based on the value at that point in time (ie price at first minute of the day), or the previous daily close?
Also, if I change the resolution of SPY to daily instead of minutely when I register it, I notice the algorithm starts trading much earlier. How come?
Also, when so many of these examples work on daily data, why do we consolidate to daily, rather than just change the registrations to daily?
Alexandre Catarino
In that algorithm, we use the EMA helper method to create an indicator that is updated by the engine:
emaShort = EMA(symbol, 10, Resolution.Daily); emaLong = EMA(symbol, 50, Resolution.Daily);
Since the defined resolution is daily, it will be updated with the previous day close.
When we use minute-resolution data, the EMA cross is evaluated after the first minute, while with daily data, it will be evaluate at the end of the day (when the market is closed). Part of the difference is probably explained by this. We would have to look into it further.
To answer you last question:
Daily resolution data is good for quick tests, but we want to use higher resolution data to get closer to real time data. One core diffrence is that orders are filled during the day which it is impossible to happen with daily resolution data.
StewartB
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.
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!