커뮤니티
지표식 보정
2017-03-10 12:37:47
131
글번호 107673
아래 StochRSI 지표 갭보정 부탁드립니다. 미리 감사드립니다. 수고하세요
Input : Period1(14),sto1(14);
var : Sma1(0),Sma2(0),Sma3(0),StochRSI(0);
Sma1 = RSI(Period1);
Sma2 = lowest(Sma1,sto1);
Sma3 = Highest(Sma1,sto1);
StochRSI = ((Sma1-Sma2)/(Sma3-Sma2))*100;
Plot1(StochRSI, "StochRSI");
PlotBaseLine1(20, "기준선20");
PlotBaseLine2(80, "기준선80");
PlotBaseLine3(50, "기준선50");
답변 1
예스스탁 예스스탁 답변
2017-03-10 12:47:04
안녕하세요
예스스탁입니다.
Input : RSIPeriod(14),sto1(14);
var : Sma1(0),Sma2(0),Sma3(0),StochRSI(0);
Variables: RSIcount(0), DownAmt(0), UpAmt(0), UpSum(0), DownSum(0), UpAvg(0), DownAvg(0),RSIv(0);
var : sumGap(0), gap(0), GO(0), GH(0), GL(0), GC(0);
if date!=date[1] then {
gap = Open-Close[1];
sumGap = sumGap+gap;
}
GO = O - sumGap;
GH = H - sumGap;
GL = L - sumGap;
GC = C - sumGap;
If CurrentBar == 1 AND RSIPeriod > 0 Then Begin
UpSum = 0;
DownSum = 0;
For RSIcount = 0 To RSIPeriod - 1 Begin
UpAmt = GC[RSIcount] - GC[RSIcount+1];
If UpAmt >= 0 Then
DownAmt = 0;
Else Begin
DownAmt = -UpAmt;
UpAmt = 0;
End;
UpSum = UpSum + UpAmt;
DownSum = DownSum + DownAmt;
End;
UpAvg = UpSum / RSIPeriod;
DownAvg = DownSum / RSIPeriod;
End
Else
If CurrentBar > 1 AND RSIPeriod > 0 Then Begin
UpAmt = GC[0] - GC[1];
If UpAmt >= 0 Then
DownAmt = 0;
Else Begin
DownAmt = -UpAmt;
UpAmt = 0;
End;
UpAvg = (UpAvg[1] * (RSIPeriod - 1) + UpAmt) / RSIPeriod;
DownAvg = (DownAvg[1] * (RSIPeriod - 1) + DownAmt) / RSIPeriod;
End;
If UpAvg + DownAvg <> 0 Then
RSIv = 100 * UpAvg / (UpAvg + DownAvg);
Else
RSIv = 0;
Sma1 = RSIV;
Sma2 = lowest(Sma1,sto1);
Sma3 = Highest(Sma1,sto1);
StochRSI = ((Sma1-Sma2)/(Sma3-Sma2))*100;
Plot1(StochRSI, "StochRSI");
PlotBaseLine1(20, "기준선20");
PlotBaseLine2(80, "기준선80");
PlotBaseLine3(50, "기준선50");
즐거운 하루되세요
> 산과바다 님이 쓴 글입니다.
> 제목 : 지표식 보정
> 아래 StochRSI 지표 갭보정 부탁드립니다. 미리 감사드립니다. 수고하세요
Input : Period1(14),sto1(14);
var : Sma1(0),Sma2(0),Sma3(0),StochRSI(0);
Sma1 = RSI(Period1);
Sma2 = lowest(Sma1,sto1);
Sma3 = Highest(Sma1,sto1);
StochRSI = ((Sma1-Sma2)/(Sma3-Sma2))*100;
Plot1(StochRSI, "StochRSI");
PlotBaseLine1(20, "기준선20");
PlotBaseLine2(80, "기준선80");
PlotBaseLine3(50, "기준선50");