Skip to content

Commit 2388836

Browse files
committed
Add wilders_rsi indicator
1 parent 262da9e commit 2388836

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

README.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ pip install pyindicators
1919
* [Exponential Moving Average (EMA)](#exponential-moving-average-ema)
2020
* Momentum indicators
2121
* [Relative Strength Index (RSI)](#relative-strength-index-rsi)
22+
* [Relative Strength Index Wilders method (RSI)](#relative-strength-index-rsi)
2223

2324
## Indicators
2425

@@ -99,7 +100,32 @@ pd_df = ema(pd_df, source_column="Close", period=200, result_column="RSI_14")
99100
pd_df.tail(10)
100101
```
101102

102-
![EMA](https://github.com/coding-kitties/PyIndicators/blob/main/static/images/indicators/rsi.png)
103+
![RSI](https://github.com/coding-kitties/PyIndicators/blob/main/static/images/indicators/rsi.png)
104+
105+
#### Wilders Relative Strength Index (Wilders RSI)
106+
107+
```python
108+
from investing_algorithm_framework import CSVOHLCVMarketDataSource
109+
110+
from pyindicators import wilders_rsi
111+
112+
# For this example the investing algorithm framework is used for dataframe creation,
113+
csv_path = "./tests/test_data/OHLCV_BTC-EUR_BINANCE_15m_2023-12-01:00:00_2023-12-25:00:00.csv"
114+
data_source = CSVOHLCVMarketDataSource(csv_file_path=csv_path)
115+
116+
pl_df = data_source.get_data()
117+
pd_df = data_source.get_data(pandas=True)
118+
119+
# Calculate SMA for Polars DataFrame
120+
pl_df = wilders_rsi(pl_df, source_column="Close", period=200, result_column="RSI_14")
121+
pl_df.show(10)
122+
123+
# Calculate SMA for Pandas DataFrame
124+
pd_df = wilders_rsi(pd_df, source_column="Close", period=200, result_column="RSI_14")
125+
pd_df.tail(10)
126+
```
127+
128+
![RSI](https://github.com/coding-kitties/PyIndicators/blob/main/static/images/indicators/wilders_rsi.png)
103129

104130
### Indicator helpers
105131

0 commit comments

Comments
 (0)