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
I'm a newer graduate (so I am not 100% confident in this), but I am pretty sure that the method used in this calculation is a standard weighted average instead of "Wilder's" weighted average. In order to get Wilder's we need to recursively calculate the average based on the previous averages. This can be fixed by changing the ewm method for up and down days to :
# Calculate the EWMA for the Up days.
self._frame['ewma_up'] = self._price_groups['up_day'].transform(
lambda x: x.ewm(alpha=1.0 / period,adjust=False).mean()
)
Also, when putting the Relative Strength index into the dataframe, the given method only returned values over 95. So I modified it to directly put the Relative strength index variable into the dataframe. Although, when I look at the given method, I am not sure why it doesn't work. Essentially no RSI values should ever be 0 or 100, so wouldn't the np.where statement parameters 0, 100 be essentially ignored?
# Calculate the Relative Strength Index
self._frame['rsi'] = 100.0 - (100.0 / (1.0 + relative_strength))
The text was updated successfully, but these errors were encountered:
I'm a newer graduate (so I am not 100% confident in this), but I am pretty sure that the method used in this calculation is a standard weighted average instead of "Wilder's" weighted average. In order to get Wilder's we need to recursively calculate the average based on the previous averages. This can be fixed by changing the ewm method for up and down days to :
Also, when putting the Relative Strength index into the dataframe, the given method only returned values over 95. So I modified it to directly put the Relative strength index variable into the dataframe. Although, when I look at the given method, I am not sure why it doesn't work. Essentially no RSI values should ever be 0 or 100, so wouldn't the np.where statement parameters 0, 100 be essentially ignored?
The text was updated successfully, but these errors were encountered: