퀀트 기술
-
PER(Price Earnings Ratio, 주가수익비율)퀀트 기술 2023. 7. 10. 23:26
1. PER 이란 기업의 본질은 이윤을 추구하는데 있다. 그러므로 기업의 가치를 판단하는 가장 큰 척도는 이윤이다. 그래서 기업에 대한 가치를 판단하는 지표를 만들었느데 그것을 PER이라고 한다. PER은 Price Earnings Ratio라고 하고 P/E Ratio 라고 쓴다. PER = 가격 / EPS로 계산한다. 2. 애플의 PER 역시 애플의 재무제표를 가져와서 PER을 그려보자. 기간은 10년으로 2013부터 2022년까지이다. 파란색이 PER 지표이고, 빨간색이 주가 그래프이다. 3. 애플 PER의 멀티플 Multiple 밴드 주가와 PER지표는 양의 상관관계를 갖는 것처럼 보인다. 보통 PER과 같이 재무제표와 주가가 결합하여 주가배수를 Multiple이라고 부른다. 멀티플이라고 하면되는데..
-
Stochastic(스토캐스틱)퀀트 기술 2023. 7. 9. 14:51
1. Stochastic 스토캐스틱이란 스토캐스틱은 최근일 기준으로 N일간의 주가를 바탕으로 현재 주가가 어느 수준에 있는지 판단하기 위한 지표이다. 이 지표는 1950년대 조지 레인이라는 사람이 만든 지표다. 조지 레인은 이 지표의 기준을 설정했는데, 처음에 스토캐스틱 계산하는 기간을 N, 이 스토캐스틱을 가지고 이동평균값을 계산하여 Slow K를 계산하는데 이 때 이용하는 기간을 M, Slow K에서 Slow D로 이동평균을 계산하는데 필요한 기간은 T 이것을 함수로 표기하면 STO(N, M, T)로 표시한다. 레인은 기본값을 STO(14, 3, 3)으로 제시했다. 즉 14일간의 간격 데이터로 스토캐스틱을 계산하고, 3일간의 스토캐스틱으로 Slow K를 계산하고, 3일간의 Slow K로 Slow D를..
-
Bollinger Band(볼린저밴드)퀀트 기술 2023. 7. 7. 23:34
1. Bollinger Band 볼린저 밴드 란 볼린저밴드는 이동평균선에 변동성을 결한한 지표이다. 이동평균선이 중심이 되고, 밴드의 상단과 하단은 이동평균의 +, - 의 표준편차로 표현한다. 즉, 밴드의 중심선은 N일의 이동평균선이고 밴드의 상단은 N일의 이동평균 + K * 표준편차, 밴드의 상단은 N일의 이동평균 - K * 표준편차이다. 볼린저밴드는 보통 N, K로 표시하는데 N은 이동평균을 구하는 윈도우 사이즈, K는 표준편차의 몇 배를 밴드 사이즈에 반영할지 결정하는 상수이다. 볼린저 밴드는 2가지로 활요할 수 있는데 평균회귀 전략으로는 밴드의 하단을 매매하고, 모멘텀 전략은 밴드의 상단을 매매한다. 평균회귀 전략은 Envelope전략과 동일하게 볼린저 밴드의 지지선을 상향 돌파할 때 매수하고, ..
-
Envelope(엔벨로프)퀀트 기술 2023. 7. 6. 22:17
1. Envelope 엔벨로프 란 이동평균선 중에서 가장 간단한 지표가 envlope이다. 주가가 봉투처럼 감싼다고 엔벨로프라고 한다. 엔벨로프의 중심과 위아래 각각 선이 있는데 이 영역의 중심선은 이동평균선이다. 그 위와 아래는 이동평균선보다 몇% 벌어진 가격을 표시한다. 위에 있는 상한선을 저항선, 아래 있는 하한선을 지지선이라고 부른다. 2. 애플 주가와 Envelope(엔벨로프) 애플 주가를 가지고 테스트를 해보자. 2020년 1월 부터 2020년 12월까지의 데이터이며 이 그래프에 Envelope를 그려보자 이동평균을 계산할 window 사이즈는 20으로 설정한다. 엔벨로프를 그려보자. 3. Envelope를 이용한 백테스팅 이 Envelope주기를 지표를 가지고 모멘텀 전략을 사용해보자. 상단..
-
RSI(Relative Strength Index)퀀트 기술 2023. 7. 5. 22:04
1. RSI 란 RSI(Relative Strength Index)는 상대 지수라고도 부르며, 주가의 상승 강도를 측정하는 지표이다. 일정 기간 동안 상승폭과 하락폭을 계산하고, 그 폭이 얼마인지 비율을 계산하여 백분율로 나타낸다. RSI지표로 투자 전략을 세운다면 보통 70이상이면 과매수 구간이고, 30이하면 과매도 구간으로 분류한다. 과매수는 주식을 너무 많이 매수해서 과열되었다는 것이고, 과매도는 주식을 너무 매도해서 과열되었다는 것이다. 그래서 과매도 구간에서 주식을 사고, 과매수 구간에서 주식을 팔면 된다 2. 애플 주가와 RSI 그렇다면 애플을 가지고 테스트해보자. 2020년 1월부터 2020년 12월까지 주가 그래프이다. 이 차트에 RSI 그래프를 추가해보자. 윈도우 사이즈는 14로 설정했다..
-
MACD(Moving Average Convergence Divergence)퀀트 기술 2023. 7. 4. 22:38
1. MACD 란 MACD(Moving Average Convergence Divergence)는 이동평균수렴확산지수라고 한다. 쉽게 말하면, 5일 이동평균선과 20일 이동평균선 사이의 관계에서 추세를 찾는 지표다. 즉, 5일 이동평균선이 20일 이동평균선 위에 있으면 상승 추세다라고 말을 할 수 있다. 그러나 이동평균선은 과거 어느 시점부터 현재까지의 평균 주가를 가지고 구하는 것이라, 실제 보다 후행할 수 밖에 없다. 이것을 극복하기 위해서 하나의 트릭을 추가했다. 간단한데, 이동평균을 구할 때 단순평균이 아니라 지수이동평균이라고 최근 값에 가중치를 준것이다. 최근 값에 더 민감하게 가중치를 줘서 정확도를 높이기 위함이다. MACD는 단기이동평균에서 장기이동평균을 빼준 값으로 MACD가 양수이면 주가..