You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lag.xts lags a timeseries in the correct direction, and defaults to 1, so it will always lag 'back' from the current observation. lag in base R lags the wrong direction (for time series).
While the supersmoother works perfectly well for xts type objects, it doesn't have the leading NAs for zoo type objects. hence I felt there was somehting wrong with the code.
Hi Ilya,
First up, many thanks for making available the Dr. Ehler indicators in R. I am slowly exploring them and came across the superSmoother function.
I believe the line
filt <- c1*(x+lag(x))/2
should actually be
filt <- c1*(x+lag(x, k=-1))/2 to match Dr. Ehlers equation given in the book 'Cycle Analytics for Traders'.
Can you please check?
Thanks,
Najmuddin
The text was updated successfully, but these errors were encountered: