[Python] pandas_ta를 사용하여 RSI 정보 가져오기
2024. 1. 2. 06:49ㆍ카테고리 없음
1. pandas_ta를 사용하여 RSI 정보 가져오기
이전에 파이썬의 finta를 사용하여 RSI 정보를 가져오는 예제를 소개하였다.
이번에는 pandas_ta를 사용하여 RSI정보를 가져오는 예제를 소개해 보려한다.
설치방법
윈도우 | pip install pandas_ta |
리눅스 | pip install pandas_ta |
사용방법
# pandas_ta 를 사용하기 위한 선언
import pandas_ta as PANTA
# 한국투자증권을 사용하거나 pykrx를 사용하여 해당 dataframe 정보를 가져온다.
self.df = self.KIS_KR.GetOhlcvA(ticker, df_cnt)
# finta를 사용하여 해당 RSI 정보를 가져온다.
# 기본적으로 14를 사용하지만 일부 변경이 필요하여 8로 변경하였다.
RSI_N1 = PANTA.rsi(self.df['close'], 8)
RSI_1 = RSI_N1.iloc[-1]
RSI_2 = RSI_N1.iloc[-2]
RSI_3 = RSI_N1.iloc[-3]
RSI_4 = RSI_N1.iloc[-4]
해당정보를 가져왔다. (아래 이미지)
더 많은 정보는 아래 링크에서 확인할 수 있다.
https://github.com/twopirllc/pandas-ta
GitHub - twopirllc/pandas-ta: Technical Analysis Indicators - Pandas TA is an easy to use Python 3 Pandas Extension with 130+ In
Technical Analysis Indicators - Pandas TA is an easy to use Python 3 Pandas Extension with 130+ Indicators - GitHub - twopirllc/pandas-ta: Technical Analysis Indicators - Pandas TA is an easy to us...
github.com
Candles (64)
Patterns that are not bold, require TA-Lib to be installed: pip install TA-Lib
- 2crows
- 3blackcrows
- 3inside
- 3linestrike
- 3outside
- 3starsinsouth
- 3whitesoldiers
- abandonedbaby
- advanceblock
- belthold
- breakaway
- closingmarubozu
- concealbabyswall
- counterattack
- darkcloudcover
- doji
- dojistar
- dragonflydoji
- engulfing
- eveningdojistar
- eveningstar
- gapsidesidewhite
- gravestonedoji
- hammer
- hangingman
- harami
- haramicross
- highwave
- hikkake
- hikkakemod
- homingpigeon
- identical3crows
- inneck
- inside
- invertedhammer
- kicking
- kickingbylength
- ladderbottom
- longleggeddoji
- longline
- marubozu
- matchinglow
- mathold
- morningdojistar
- morningstar
- onneck
- piercing
- rickshawman
- risefall3methods
- separatinglines
- shootingstar
- shortline
- spinningtop
- stalledpattern
- sticksandwich
- takuri
- tasukigap
- thrusting
- tristar
- unique3river
- upsidegap2crows
- xsidegap3methods
- Heikin-Ashi: ha
- Z Score: cdl_z
반응형