[Python] Commodity Channel Index CCI 추출 하기위한 파이썬 코드

2024. 1. 10. 08:33카테고리 없음

쿼트 자동화를 위하여 CCI를 활용한 매수의 진입시점을 확인하고자 하여 볼린저밴드 추출방법을 공유하고자 합니다 .

 

1. 라이블러리설치

pip install finta

 

2. 데이터프레임 추출

df = self.GetOhlcv(stock_code, "D")

 

3. 데이터프레임을 CCI 데이터로 추출

from finta import TA

ar_CCI = []
CCI = TA.CCI(self.df, 20)
CCI_1 = CCI.iloc[-1]
CCI_2 = CCI.iloc[-2]
CCI_3 = CCI.iloc[-3]
CCI_4 = CCI.iloc[-4]
CCI_5 = CCI.iloc[-5]

 

 

정상적으로 추출되었다. 현재의 상태는 상승중에 있다. 

 

https://github.com/peerchemist/finta

 

GitHub - peerchemist/finta: Common financial technical indicators implemented in Pandas.

Common financial technical indicators implemented in Pandas. - GitHub - peerchemist/finta: Common financial technical indicators implemented in Pandas.

github.com

 

반응형