We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSI function : Args : df : Pandas DataFrame which contains ['date', 'open', 'high', 'low', 'close', 'volume'] columns base : String indicating the column name from which the MACD needs to be computed from (Default close) period : Integer indicates the period of computation in terms of number of candles Returns : df : Pandas DataFrame with new columns added for Relative Strength Index (RSI_$period) """ delta = df[base].diff() up, down = delta.copy(), delta.copy() if len(delta)>(period-1): up[up < 0] = 0 down[down > 0] = 0 rUp = up.ewm(com=period - 1, adjust=False).mean() rDown = down.ewm(com=period - 1, adjust=False).mean().abs() df['RSI_' + str(period)] = 100 - 100 / (1 + rUp / rDown) df['RSI_' + str(period)].fillna(0, inplace=True) else: df['RSI_' + str(period)] = pd.Series() df['RSI_' + str(period)].fillna(0, inplace=True) return df
`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
`
The text was updated successfully, but these errors were encountered: