커뮤니티
수식 도움 부탁드립니다.
2013-05-12 16:24:25
250
글번호 63091
연결선물 일봉 챠트에서 주봉 RSI 와 주봉 STOCASTIC SLOW k 을 볼수 있는 수식 작성 부탁드립니다.
분봉에서 일봉상의 RSI/STOCASTIC slow을 볼수 있는 수식은 있는데 말이죠..
stochastics slow는 아래와 같이 사용 하고 있습니다.
StochasticsSlowK = accumn(C-Lowest(L,Period),Period1)/accumn((highest(H,Period)-lowest(L,Period)),Period1)*100;
항상 도움에 감사 드립니다. (__)
답변 1
예스스탁 예스스탁 답변
2013-05-13 14:03:21
안녕하세요
예스스탁입니다.
1.
Inputs:Length(9);
Variables: Counter(0), DownAmt(0), UpAmt(0), UpSum(0), DownSum(0), UpAvg(0), DownAvg(0), wRSI(0);
var : Dindex(0), PreUpAvg(0), preDownAvg(0),cnt1(0);
Array : CC[100](0);
if DayOfWeek(sdate) <= DayOfWeek(sdate[1]) and sdate > sdate[1] Then{
for cnt1 = 1 to 99{
CC[cnt1] = CC[cnt1-1][1];
}
PreUpAvg = UpAvg[1];
preDownAvg = DownAvg[1];
Dindex = dindex + 1;
}
CC[0] = C;
If Dindex <= Length Then Begin
UpSum = 0;
DownSum = 0;
For Counter = 0 To Length - 1 Begin
UpAmt = C[Counter] - C[Counter+1];
If UpAmt >= 0 Then
DownAmt = 0;
Else Begin
DownAmt = -UpAmt;
UpAmt = 0;
End;
UpSum = UpSum + UpAmt;
DownSum = DownSum + DownAmt;
End;
UpAvg = UpSum / Length;
DownAvg = DownSum / Length;
End
If Dindex > Length Then {
UpAmt = CC[0]-Cc[1];
If UpAmt >= 0 Then
DownAmt = 0;
Else
{
DownAmt = -UpAmt;
UpAmt = 0;
}
if Dindex <=1 Then {
UpAvg = 1;
DownAvg = 1;
}
Else {
UpAvg = (PreUpAvg * (Length - 1) + UpAmt) / Length;
DownAvg = (preDownAvg * (Length - 1) + DownAmt) / Length;
}
}
If UpAvg + DownAvg <> 0 Then
wRSI = 100 * UpAvg / (UpAvg + DownAvg);
Else
wRSI = 0;
plot1(wRSI,"RSI");
PlotBaseLine1(30, "기준선 30", gray);
PlotBaseLine2(70, "기준선 70", gray);
2.
input : Period(10),Period1(5);
var : cnt(0),sum1(0),sum2(0),StochasticsSlowK(0);
Array : HH[100](0),LL[100](0),CC[100](0),Hest[100](0),Lest[100](0);
if DayOfWeek(sdate) <= DayOfWeek(sdate[1]) and sdate > sdate[1] Then{
HH[0] = H;
LL[0] = L;
for cnt = 1 to 99{
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
CC[cnt] = CC[cnt-1][1];
Hest[cnt] = Hest[cnt-1][1];
Lest[cnt] = Lest[cnt-1][1];
}
}
if H > HH[0] Then
HH[0] = H;
if L < LL[0] Then
LL[0] = L;
CC[0] = C;
Hest[0] = HH[0];
Lest[0] = LL[0];
for cnt = 0 to Period-1{
if HH[cnt] > Hest[0] Then
Hest[0] = HH[cnt];
if LL[cnt] < Lest[0] Then
Lest[0] = LL[cnt];
}
sum1 = 0;
sum2 = 0;
for cnt = 0 to Period1-1{
sum1 = sum1+(CC[cnt]-Lest[cnt]);
sum2 = sum2+(Hest[cnt]-Lest[cnt]);
}
StochasticsSlowK = Sum1/Sum2*100;
plot1(StochasticsSlowK);
즐거운 하루되세요
> WT_nazilo75 님이 쓴 글입니다.
> 제목 : 수식 도움 부탁드립니다.
> 연결선물 일봉 챠트에서 주봉 RSI 와 주봉 STOCASTIC SLOW k 을 볼수 있는 수식 작성 부탁드립니다.
분봉에서 일봉상의 RSI/STOCASTIC slow을 볼수 있는 수식은 있는데 말이죠..
stochastics slow는 아래와 같이 사용 하고 있습니다.
StochasticsSlowK = accumn(C-Lowest(L,Period),Period1)/accumn((highest(H,Period)-lowest(L,Period)),Period1)*100;
항상 도움에 감사 드립니다. (__)