예스스탁
예스스탁 답변
2025-03-27 13:22:33
안녕하세요
예스스탁입니다.
input : 분(60),n(3);
var : S1(0),D1(0),TM(0),TF(0),HH(0),LL(0),cnt(0),hcnt(0),lcnt(0),bar(0);
Array : HTL[100](0),HTLV[100](0),LTL[100](0),LTLV[100](0);
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
HH = H;
LL = L;
Condition1 = true;
Condition2 = true;
bar = 0;
hcnt = 0;
lcnt = 0;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF = TM%분;
if (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
{
bar = bar+1;
Condition1 = False;
Condition2 = False;
Condition3 = true;
if Condition1[1] == true Then
{
HTLV[hcnt] = Open;
HTL[hcnt] = TL_New(Sdate,Stime,HTLV[hcnt],NextBarSdate,NextBarStime,HTLV[hcnt]);
TL_SetColor(HTL[hcnt],Red);
hcnt = Hcnt+1;
}
if Condition2[1] == true Then
{
LTLV[lcnt] = O;
LTL[lcnt] = TL_New(Sdate,Stime,LTLV[lcnt],NextBarSdate,NextBarStime,LTLV[lcnt]);
TL_SetColor(LTL[hcnt],Blue);
lcnt = lcnt+1;
}
}
if H > HH then
{
HH = H;
Condition1 = true;
}
if L < LL then
{
LL = L;
Condition1 = true;
}
if bar >= 1 Then
{
for cnt = 0 to Hcnt
{
TL_SetEnd(HTL[cnt],NextBarSdate,NextBarStime,HTLV[cnt]);
}
for cnt = 0 to Lcnt
{
TL_SetEnd(LTL[cnt],NextBarSdate,NextBarStime,LTLV[cnt]);
}
if Hcnt >= n Then
TL_Delete(HTL[n]);
if Lcnt >= n Then
TL_Delete(LTL[n]);
}
}
즐거운 하루되세요
> 부활 님이 쓴 글입니다.
> 제목 : 수식 문의 드립니다.
>
안녕하세요.
다음 수식은 며칠전 문의 드린 고저가 갱신시 수평선을 설정한것인데
60분봉에서 생성된 고저가 수평선을 10분봉이나 5분봉에 적용되게 변경가능한가요?
input : n(3);
var : HH(0),LL(0),cnt(0),hcnt(0),lcnt(0);
Array : HTL[100](0),HTLV[100](0),LTL[100](0),LTLV[100](0);
if Bdate != Bdate[1] Then
{
HH = H;
LL = L;
hcnt = 0;
HTLV[hcnt] = NextBarOpen;
HTL[hcnt] = TL_New(Sdate,Stime,HTLV[hcnt],NextBarSdate,NextBarStime,HTLV[hcnt]);
TL_SetColor(HTL[hcnt],Red);
lcnt = 0;
LTLV[lcnt] = NextBarOpen;
LTL[lcnt] = TL_New(Sdate,Stime,LTLV[lcnt],NextBarSdate,NextBarStime,LTLV[lcnt]);
TL_SetColor(LTL[hcnt],Blue);
}
Else
{
if H > HH then
{
HH = H;
hcnt = Hcnt+1;
HTLV[hcnt] = NextBarOpen;
HTL[hcnt] = TL_New(Sdate,Stime,HTLV[hcnt],NextBarSdate,NextBarStime,HTLV[hcnt]);
TL_SetColor(HTL[hcnt],Red);
}
if L < LL then
{
LL = L;
lcnt = lcnt+1;
LTLV[lcnt] = NextBarOpen;
LTL[lcnt] = TL_New(Sdate,Stime,LTLV[lcnt],NextBarSdate,NextBarStime,LTLV[lcnt]);
TL_SetColor(LTL[hcnt],Blue);
}
for cnt = 0 to Hcnt
{
TL_SetEnd(HTL[cnt],NextBarSdate,NextBarStime,HTLV[cnt]);
}
for cnt = 0 to Lcnt
{
TL_SetEnd(LTL[cnt],NextBarSdate,NextBarStime,LTLV[cnt]);
}
if Hcnt >= n Then
TL_Delete(HTL[n]);
if Lcnt >= n Then
TL_Delete(LTL[n]);
}