답변완료
수식 문의 드립니다.
고생많이 하십니다.
아래수식은 문의드린 60분봉의 고저가 갱신시 다음봉 시가를 수평선으로 표시한 것인데
아래수식에서 조건추가 할수 있습니까?
ex) 제가 임의로 설정한 기준선(시가, 중앙선, 주봉 고가 등)에서
고저가 갱신시에만 수평선을 표시할 수 있는지 문의 드립니다.
(첨부파일 중 1번 : 시가 부근 시작 후 고가갱신
2번 : 중앙선 부근 시작 후 저가갱신)
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]);
}
}
2025-03-27
313
글번호 189642
지표