예스스탁
예스스탁 답변
2021-02-08 13:16:22
안녕하세요
예스스탁입니다.
1 타분봉 시고저종
Input : 분(5);
var : cnt(0),S1(0),D1(0),TM(0),TF(0);
Array : O1[100](0),H1[100](0),L1[100](0),C1[100](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TimeToMinutes(stime)%분;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 분 > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and 분 > 1 and TM >= TM[1]+분) or
(Bdate == Bdate[1] and 분 == 1 and TM > TM[1]) Then
{
O1[0] = O;
H1[0] = O;
L1[0] = O;
for cnt = 1 to 99{
C1[cnt] = C1[cnt-1][1];
}
}
if H > H1[0] Then
H1[0] = H;
if L < L1[0] Then
L1[0] = L;
C1[0] = C;
Plot1(O1[0]);
Plot2(H1[0]);
Plot3(L1[0]);
Plot4(C1[0]);
}
2. 타분봉 RSI
Input : 분(5), Length(14);
var : cnt(0),S1(0),D1(0),TM(0),TF(0);
var : SigSum(0),count2(0),RSIsig(0);
Var : Counter(0), DownAmt(0), UpAmt(0), UpSum(0), DownSum(0), UpAvg(0), DownAvg(0);
var : idx(0), PreUpAvg(0), preDownAvg(0),RSIV(0);
Array : C1[100](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TimeToMinutes(stime)%분;
if Bdate != Bdate[1] or
(Bdate == Bdate[1] and 분 > 1 and TF < TF[1]) or
(Bdate == Bdate[1] and 분 > 1 and TM >= TM[1]+분) or
(Bdate == Bdate[1] and 분 == 1 and TM > TM[1]) Then
{
for cnt = 1 to 99{
C1[cnt] = C1[cnt-1][1];
}
PreUpAvg = UpAvg[1];
preDownAvg = DownAvg[1];
idx = idx + 1;
}
C1[0] = C;
If idx == Length+2 Then {
UpSum = 0;
DownSum = 0;
For Counter = 0 To Length - 1 {
UpAmt = C1[Counter] - C1[Counter+1];
If UpAmt >= 0 Then
DownAmt = 0;
Else{
DownAmt = -UpAmt;
UpAmt = 0;
}
UpSum = UpSum + UpAmt;
DownSum = DownSum + DownAmt;
}
UpAvg = UpSum / Length;
DownAvg = DownSum / Length;
}
If idx > Length+2 Then {
UpAmt = C1[0] - C1[1];
If UpAmt >= 0 Then
DownAmt = 0;
Else {
DownAmt = -UpAmt;
UpAmt = 0;
}
UpAvg = (PreUpAvg * (Length - 1) + UpAmt) / Length;
DownAvg = (preDownAvg * (Length - 1) + DownAmt) / Length;
}
If UpAvg + DownAvg <> 0 Then
RSIv = 100 * UpAvg / (UpAvg + DownAvg);
Else
RSIv = 0;
plot1(RSIv,"RSI");
}
즐거운 하루되세요
> trade924 님이 쓴 글입니다.
> 제목 : 수식 문의
> 하위 타임프레임에서 현재의 가격 데이터를 바탕으로 상위 타임프레임의 지표를 생성하고자 합니다.
1분봉 데이터만 주어졌을 때, 5분봉에서의 시고저종과 RSI를 그려주는 지표에 대한 수식을 부탁드리고 싶습니다.
감사합니다.