I was looking through the documentation and couldn't figure out what the EMA calculation period is based on. Is it based on the resolution of the underlying asset that it is tied to? For example, if SPY is minute resolution, and we define an EMA("SPY"), is it then using 8-minute lags for the calculation?
R G Quant
You can find the EMA code here:
I found that having a look at the code is the fastest way to solve my doubts. Luckily it is open source ;)
R G Quant
Sorry, I see now that you were referring to the algorithm's shortcut method for the indicator.
You can find its code here:
The period is a mandatory parameter. E.g EMA(spy, 14)
Fred Painchaud
Hi Nick,
I don't understand exactly where you take your “8-minute lag” from but in a nutshell, when you declare an EMA, you set whatever period and resolution that you want.
So you can easily do the infamous MTF (Multi Time-Frame).
For instance, you can subscribe to minute data on SPY but then have an EMA("SPY", 60, Resolution.Minute) and an EMA("SPY", 1, Resolution.Daily) in the same algo, thus doing EMA on hour and day timeframes.
Fred
Nick Abram
I have already reviewed the documentation, but I"m not too familiar with C#, so I can't see where the units on period are in the code below. Any clarification would be of great help. Thank you. Is it minutes, hours, days? Does it depend on the underlying resolution?
Nick Abram
Hi Fred, Thanks for the answer, this is what I was looking for. It wasn't clear from the documentation or the code. I'm not too familiar with C#, I code in python.
Nick Abram
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!