커뮤니티
간단한 질문.
2011-01-24 13:49:59
806
글번호 35229
분봉 챠트에서 일봉
slow stochastc 을 적용하고 싶습니다.
수식 부탁 드려요.
그럼 좋은 하루 되세요.
답변 1
예스스탁 예스스탁 답변
2011-01-24 17:45:07
안녕하세요
예스스탁입니다.
input : Period(20), Period1(12), Period2(12);
var : count(0), highVal(0), lowVal(0), StoFastK(0), StoK(0), StoD(0);
var : Ep(0), EP1(0), JISU(0), DINDEX(0), PreStoK(0), PreStoD(0);
#### 특정 구간의 고가 [highest(H,Period)] ####
highVal = dayhigh(0);
for count = 0 to Period-1 {
if dayHigh(count) > highVal then
highVal = dayhigh(count);
}
#### 특정 구간의 저가 [lowest(L,Period)] ####
lowVal = daylow(0);
for count = 0 to Period-1 {
if dayLow(count) < lowVal then
lowVal = dayLow(count);
}
#### Fast StochasticsK ####
StoFastK = (C-lowVal)/(highVal-lowVal)*100;
#### Slow StochasticsK ####
Ep = 2/(Period1+1);
#### Slow StochasticsD ####
Ep1 = 2/(Period2+1);
if date != date[1] then {
DINDEX = DINDEX + 1;
PreStoK = StoK[1];
}
if DINDEX <= 1 then
StoK = StoFastK ;
else
StoK = StoFastK * EP + PreStoK * (1-EP);
if date != date[1] then {
DINDEX = DINDEX + 1;
PreStoD = StoD[1];
}
if DINDEX <= 1 then
StoD = StoK ;
else
StoD = StoK * EP1 + PreStoD * (1-EP1);
plot1(StoK);
plot2(StoD);
즐거운 하루되세요
> 휴식 님이 쓴 글입니다.
> 제목 : 간단한 질문.
> 분봉 챠트에서 일봉
slow stochastc 을 적용하고 싶습니다.
수식 부탁 드려요.
그럼 좋은 하루 되세요.