커뮤니티
지표문의
2016-10-02 05:49:41
102
글번호 102421
일봉의 슬로우 스토캐스틱 지표를 분봉에 표시하고 싶습니다.
답변 1
예스스탁 예스스탁 답변
2016-10-04 13:41:58
안녕하세요
예스스탁입니다.
스토케스틱은 과거 봉수에 영향을 받습니다.
분봉에서 일봉을 구현할 경우에 봉수 문제로
값이 같지 않을수 있습니다.
이용에 참고하시기 바랍니다.
input : Period(10), Period1(5), Period2(5);
var : cnt(0), highVal(0), lowVal(0), FK(0), SK(0), SD(0);
var : Ep1(0), Ep2(0), PreSK(0), PreSD(0);
#N일간 최고가 및 최저가
highVal = dayhigh(0);
lowVal = daylow(0);
for cnt = 0 to Period-1 {
if dayHigh(cnt) > highVal then
highVal = dayhigh(cnt);
if dayLow(cnt) < lowVal then
lowVal = dayLow(cnt);
}
#Fast StochasticsK
fK = (C-lowVal)/(highVal-lowVal)*100;
#Slow StochasticsK / Slow StochasticsD
Ep1 = 2/(Period1+1);
Ep2 = 2/(Period2+1);
if date != date[1] then {
PreSK = SK[1];
PreSD = SD[1];
}
SK = FK * EP1 + PreSK * (1-EP1);
SD = SK * EP2 + PreSD * (1-EP2);
plot1(SK,"일봉 SlowK");
plot2(SD,"일봉 SlowD");
PlotBaseLine1(20);
PlotBaseLine2(80);
즐거운 하루되세요
> 쭈니오빠 님이 쓴 글입니다.
> 제목 : 지표문의
> 일봉의 슬로우 스토캐스틱 지표를 분봉에 표시하고 싶습니다.