커뮤니티
수식문의
2003-12-07 16:37:02
3910
글번호 1563
분봉에서 일봉지표를 볼수 없나요
예를 들어
1)macd(12,26,9) 일봉을 5분봉에서나 30분봉에서 보는 방법
2)stochastics(20,12,12)일봉을 5분봉에서나 30분봉에서 보는 방법
위 두가지를 설명과 함께 부탁드립니다
수고하십시요
답변 1
예스스탁 예스스탁 답변
2003-12-08 12:41:13
안녕하세요..예스스탁입니다.
지표식 답변드립니다.
문의하신 macd나 stochastics의 경우 지수이동평균 방법에 의해서 값을 구하기 때문에 지수이동평균을 구하는 방법으로 값을 구하게 됩니다.
이 식을 이용한 것이므로 따로 식 내용에 대해서 설명할 부분은 없을듯 싶습니다.
이해가 되지 않는 부분을 지적해서 올려주시면 추가로 답변드리도록 하겠습니다.
아래 두개의 식은 파일로 첨부합니다.
* 지수이동평균 계산식
지수이평 = C * EP + 전일의지수이평 *(1-EP)
EP = 2/(기간+1)
1)macd(12,26,9) 일봉을 5분봉에서나 30분봉에서 보는 방법
Input : Period1(12), Period2(26), Period3(9);
Var : Ep1(0), EP2(0), EP3(0), JISU1(0), JISU2(0), PreJISU1(0), PreJISU2(0);
Var : macdVal(0), preMacdVal(0), macdSig(0);
if date != date[1] then {
PreJISU1 = JISU1[1];
PreJISU2 = JISU2[1];
PreMacdVal = macdSig[1];
}
Ep1 = 2/(Period1+1);
EP2 = 2/(Period2+1);
EP3 = 2/(Period3+1);
JISU1 = C * Ep1 + PreJISU1 * (1-Ep1); //단기지수이동평균
JISU2 = C * Ep2 + PreJISU2 * (1-Ep2); //장기지수이동평균
macdVal = JISU1 - JISU2; //macd
macdSig = macdVal * Ep3 + PreMacdVal * (1-Ep3); //macd signal
plot1(macdVal);
plot2(macdSig);
2)stochastics(20,12,12)일봉을 5분봉에서나 30분봉에서 보는 방법
input : Period(20), Period1(12), Period2(12);
var : count(0), highVal(0), lowVal(0), FastK(0), SlowK(0), SlowD(0);
var : Ep1(0), Ep2(0), PreSlowK(0), PreSlowD(0);
#특정 구간의 고가 및 저가
highVal = dayhigh(0);
lowVal = daylow(0);
for count = 0 to Period-1 {
if dayHigh(count) > highVal then
highVal = dayhigh(count);
if dayLow(count) < lowVal then
lowVal = dayLow(count);
}
#Fast StochasticsK
fastK = (C-lowVal)/(highVal-lowVal)*100;
#Slow StochasticsK / Slow StochasticsD
Ep1 = 2/(Period1+1);
Ep2 = 2/(Period2+1);
if date != date[1] then {
PreSlowK = SlowK[1];
PreSlowD = SlowD[1];
}
SlowK = fastK * EP1 + PreslowK * (1-EP1);
SlowD = slowK * EP2 + PreslowD * (1-EP2);
plot1(SlowK);
plot2(SlowD);
> 초보마니아 님이 쓴 글입니다.
> 제목 : 수식문의
> 분봉에서 일봉지표를 볼수 없나요
예를 들어
1)macd(12,26,9) 일봉을 5분봉에서나 30분봉에서 보는 방법
2)stochastics(20,12,12)일봉을 5분봉에서나 30분봉에서 보는 방법
위 두가지를 설명과 함께 부탁드립니다
수고하십시요
다음글
이전글