커뮤니티
문의드립니다~
2018-06-25 10:43:06
188
글번호 119997
input : 분주기(30),P(5),분주기1(15),분주기2(4);
var : S1(0),D1(0),TM(0),TF(0);
var : cnt(0),sum(0),mav(0),tf1(0),TFF(0),entry(false),tf2(0);
Array : CC[100](0),OO[100](0),HH[100](0),LL[100](0),TT[100](0),ii[100](0),O2[100](0);
Array : C1[100](0),T1[100](0);
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) Then{
S1 = TimeToMinutes(100000);
D1 = sdate;
}
if D1 > 0 then{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TFF = TM%60;
TF = TM%분주기;
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or
(TF < TF[1]) Then{
OO[0] = o;
HH[0] = H;
LL[0] = L;
TT[0] = stime;
ii[0] = 0;
for cnt = 1 to 99{
OO[cnt] = OO[cnt-1][1];
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
CC[cnt] = CC[cnt-1][1];
TT[cnt] = TT[cnt-1][1];
ii[cnt] = ii[cnt-1][1];
}
}
if H > HH[0] Then
HH[0] = H;
if L < LL[0] Then
LL[0] = L;
CC[0] = C;
ii[0] = ii[0]+1;
TF1 = TM%분주기1;
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or
(TF1 < TF1[1]) Then{
T1[0] = stime;
for cnt = 1 to 99{
C1[cnt] = C1[cnt-1][1];
T1[cnt] = T1[cnt-1][1];
}
}
C1[0] = C;
TF2 = TM%분주기2;
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or
(TF2 < TF2[1]) Then{
O2[0] = o;
for cnt = 1 to 99{
O2[cnt] = O2[cnt-1][1];
}
}
}
var2 = (c+oo[0]+oo[1]+oo[2]+oo[3])/5 ;
var1 = oo[4];
if c > var1 and c>var2 Then{
plot1(99999999,"라인1");
plot2(0,"라인2");
}
if c < var1 and c<var2 then{
plot1(0,"라인1");
plot2(99999999,"라인2");
}
///////////////////////
틱에 적용하는 강세약세 수식인데요~
위 조건에서
종가가 var2보다 크고 var1보다 클때 빨간색
종가가 var2보다 작고 var1보다 작을때 파란색
그리고 나머지 구간에는 노락색으로 하고 싶습니다.
위 조건만 해놓으면 전체가 빨간색 파란색으로 표현이 되더라구요.
복잡해서 도움요청드립니다.`
답변 1
예스스탁 예스스탁 답변
2018-06-25 14:35:43
안녕하세요
예스스탁입니다.
채우기에서는 2개의 값만 비교되므로
plot3추가하셔서 처리하셔야 합니다.
input : 분주기(30),P(5),분주기1(15),분주기2(4);
var : S1(0),D1(0),TM(0),TF(0);
var : cnt(0),sum(0),mav(0),tf1(0),TFF(0),entry(false),tf2(0);
Array : CC[100](0),OO[100](0),HH[100](0),LL[100](0),TT[100](0),ii[100](0),O2[100](0);
Array : C1[100](0),T1[100](0);
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) Then{
S1 = TimeToMinutes(100000);
D1 = sdate;
}
if D1 > 0 then{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TFF = TM%60;
TF = TM%분주기;
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or
(TF < TF[1]) Then{
OO[0] = o;
HH[0] = H;
LL[0] = L;
TT[0] = stime;
ii[0] = 0;
for cnt = 1 to 99{
OO[cnt] = OO[cnt-1][1];
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
CC[cnt] = CC[cnt-1][1];
TT[cnt] = TT[cnt-1][1];
ii[cnt] = ii[cnt-1][1];
}
}
if H > HH[0] Then
HH[0] = H;
if L < LL[0] Then
LL[0] = L;
CC[0] = C;
ii[0] = ii[0]+1;
TF1 = TM%분주기1;
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or
(TF1 < TF1[1]) Then{
T1[0] = stime;
for cnt = 1 to 99{
C1[cnt] = C1[cnt-1][1];
T1[cnt] = T1[cnt-1][1];
}
}
C1[0] = C;
TF2 = TM%분주기2;
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or
(TF2 < TF2[1]) Then{
O2[0] = o;
for cnt = 1 to 99{
O2[cnt] = O2[cnt-1][1];
}
}
}
var2 = (c+oo[0]+oo[1]+oo[2]+oo[3])/5 ;
var1 = oo[4];
if c > var1 and c>var2 Then{
plot1(99999999,"라인1");
plot2(0,"라인2");
plot3(0,"라인3");
}
else if c < var1 and c<var2 then{
plot1(0,"라인1");
plot2(99999999,"라인2");
plot3(0,"라인3");
}
else{
plot1(0,"라인1");
plot2(0,"라인2");
plot3(99999999,"라인3");
}
즐거운 하루되세요
> 겐지 님이 쓴 글입니다.
> 제목 : 문의드립니다~
> input : 분주기(30),P(5),분주기1(15),분주기2(4);
var : S1(0),D1(0),TM(0),TF(0);
var : cnt(0),sum(0),mav(0),tf1(0),TFF(0),entry(false),tf2(0);
Array : CC[100](0),OO[100](0),HH[100](0),LL[100](0),TT[100](0),ii[100](0),O2[100](0);
Array : C1[100](0),T1[100](0);
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) Then{
S1 = TimeToMinutes(100000);
D1 = sdate;
}
if D1 > 0 then{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TFF = TM%60;
TF = TM%분주기;
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or
(TF < TF[1]) Then{
OO[0] = o;
HH[0] = H;
LL[0] = L;
TT[0] = stime;
ii[0] = 0;
for cnt = 1 to 99{
OO[cnt] = OO[cnt-1][1];
HH[cnt] = HH[cnt-1][1];
LL[cnt] = LL[cnt-1][1];
CC[cnt] = CC[cnt-1][1];
TT[cnt] = TT[cnt-1][1];
ii[cnt] = ii[cnt-1][1];
}
}
if H > HH[0] Then
HH[0] = H;
if L < LL[0] Then
LL[0] = L;
CC[0] = C;
ii[0] = ii[0]+1;
TF1 = TM%분주기1;
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or
(TF1 < TF1[1]) Then{
T1[0] = stime;
for cnt = 1 to 99{
C1[cnt] = C1[cnt-1][1];
T1[cnt] = T1[cnt-1][1];
}
}
C1[0] = C;
TF2 = TM%분주기2;
if (sdate != sdate[1] and stime >= 100000) or
(sdate == sdate[1] and (Stime == 100000 or (stime > 100000 and stime[1] < 100000))) or
(TF2 < TF2[1]) Then{
O2[0] = o;
for cnt = 1 to 99{
O2[cnt] = O2[cnt-1][1];
}
}
}
var2 = (c+oo[0]+oo[1]+oo[2]+oo[3])/5 ;
var1 = oo[4];
if c > var1 and c>var2 Then{
plot1(99999999,"라인1");
plot2(0,"라인2");
}
if c < var1 and c<var2 then{
plot1(0,"라인1");
plot2(99999999,"라인2");
}
///////////////////////
틱에 적용하는 강세약세 수식인데요~
위 조건에서
종가가 var2보다 크고 var1보다 클때 빨간색
종가가 var2보다 작고 var1보다 작을때 파란색
그리고 나머지 구간에는 노락색으로 하고 싶습니다.
위 조건만 해놓으면 전체가 빨간색 파란색으로 표현이 되더라구요.
복잡해서 도움요청드립니다.`
다음글
이전글