예스스탁
예스스탁 답변
2024-11-01 16:55:05
안녕하세요
예스스탁입니다.
input : Period(150);
Var:j(0),T(0),tx1(0),box(0),TL1(0),TL(0),TL2(0);
Var: date11(0),date12(0),time11(0),time12(0),
date21(0),date22(0),time21(0),time22(0),
date31(0),date32(0),time31(0),time32(0);
Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0);
For j = 0 To 19
{
HiBar[j] = HiBar[j] + 1;
LoBar[j] = LoBar[j] + 1;
}
if crossup(H,highest(H,Period)[1]) and (T == 0 or (T==-1 and H >= Loval[0]+0.8)) Then
T = 1;
if CrossDown(L,Lowest(L,Period)[1]) and (T == 0 or (T==1 and L <= Hival[0]-0.8)) Then
T = -1;
If T == -1 Then
{
If T[1] != -1 Then
{
For j = 18 DownTo 0
{
LoVal[j+1] = LoVal[j];
LoBar[j+1] = LoBar[j];
}
LoVal[0] = L;
LoBar[0] = 0;
date11 = date[HiBar[0]];
time11 = stime[HiBar[0]];
Value11 = HiVal[0];
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
TL_Delete(TL);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
TL_SetColor(TL1,Blue);
TL_SetSize(TL1,1);
date21 = date[HiBar[0]];
time21 = stime[HiBar[0]];
date22 = date[0];
time22 = stime[0];
Condition3 = False;
}
If LoVal[0] > L Then
{
LoVal[0] = L;
LoBar[0] = 0;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date22 = date[0];
time22 = stime[0];
}
if Condition3 == False and Value12 <= value11-0.8 Then
{
Condition3 = true;
TL2= TL_New(sDate,sTime,0,sDate,sTime,999);
TL_SetColor(TL2,Lime);
TL_SetSize(TL2,2);
}
}
If T == 1 Then
{
If T[1] != 1 Then
{
For j = 18 DownTo 0
{
HiVal[j+1] = HiVal[j];
HiBar[j+1] = HiBar[j];
}
HiVal[0] = H;
HiBar[0] = 0;
date11 = date[LoBar[0]];
time11 = stime[LoBar[0]];
Value11 = LoVal[0];
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
TL_Delete(TL);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
TL_SetColor(TL1,Red);
TL_SetSize(TL1,1);
date31 = date[LoBar[0]];
time31 = stime[LoBar[0]];
date32 = date[0];
time32 = stime[0];
Condition7 = False;
}
If HiVal[0] < H Then
{
HiVal[0] = H;
HiBar[0] = 0;
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date32 = date[0];
time32 = stime[0];
}
if Condition7 == False and Value12 >= value11+0.80 Then
{
Condition7 = true;
TL2= TL_New(sDate,sTime,0,sDate,sTime,999);
TL_SetColor(TL2,Gold);
TL_SetSize(TL2,2);
}
}
즐거운 하루되세요
> 고성 님이 쓴 글입니다.
> 제목 : 추세전환 동시
> input : Period(150);
Var:j(0),T(0),tx1(0),box(0),TL1(0),TL(0),TL2(0);
Var: date11(0),date12(0),time11(0),time12(0),
date21(0),date22(0),time21(0),time22(0),
date31(0),date32(0),time31(0),time32(0);
Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0);
For j = 0 To 19
{
HiBar[j] = HiBar[j] + 1;
LoBar[j] = LoBar[j] + 1;
}
if crossup(H,highest(H,Period)[1]) and (T == 0 or (T==-1 and H >= Loval[0]+0.8)) Then
T = 1;
if CrossDown(L,Lowest(L,Period)[1]) and (T == 0 or (T==1 and L <= Hival[0]-0.8)) Then
T = -1;
If T == -1 Then
{
If T[1] != -1 Then
{
For j = 18 DownTo 0
{
LoVal[j+1] = LoVal[j];
LoBar[j+1] = LoBar[j];
}
LoVal[0] = L;
LoBar[0] = 0;
date11 = date[HiBar[0]];
time11 = stime[HiBar[0]];
Value11 = HiVal[0];
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
TL_Delete(TL);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
TL_SetColor(TL1,Blue);
TL_SetSize(TL1,1);
date21 = date[HiBar[0]];
time21 = stime[HiBar[0]];
date22 = date[0];
time22 = stime[0];
Condition3 = False;
if Condition3 == False and Value12 <= value11-0.8 Then
{
Condition3 = true;
}
}
If LoVal[0] > L Then
{
LoVal[0] = L;
LoBar[0] = 0;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date22 = date[0];
time22 = stime[0];
}
if Condition3 == False and Value12 <= value11-0.8 Then
{
Condition3 = true;
TL2= TL_New(sDate,sTime,0,sDate,sTime,999);
TL_SetColor(TL2,Lime);
TL_SetSize(TL2,2);
}
}
If T == 1 Then
{
If T[1] != 1 Then
{
For j = 18 DownTo 0
{
HiVal[j+1] = HiVal[j];
HiBar[j+1] = HiBar[j];
}
HiVal[0] = H;
HiBar[0] = 0;
date11 = date[LoBar[0]];
time11 = stime[LoBar[0]];
Value11 = LoVal[0];
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
TL_Delete(TL);
TL = TL_New(sdate,stime,Value12,NextBarSdate,NextBarStime,NextBarOpen);
TL1 = TL_New(date11,time11,Value11,date12,time12,Value12);
TL_SetColor(TL1,Red);
TL_SetSize(TL1,1);
date31 = date[LoBar[0]];
time31 = stime[LoBar[0]];
date32 = date[0];
time32 = stime[0];
Condition7 = False;
if Condition7 == False and Value12 >= value11+0.85 Then
{
Condition7 = true;
}
}
If HiVal[0] < H Then
{
HiVal[0] = H;
HiBar[0] = 0;
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
TL_SetEnd(TL1, date12,time12,Value12);
date32 = date[0];
time32 = stime[0];
}
if Condition7 == False and Value12 >= value11+0.85 Then
{
Condition7 = true;
TL2= TL_New(sDate,sTime,0,sDate,sTime,999);
TL_SetColor(TL2,Gold);
TL_SetSize(TL2,2);
}
}
0.8 이상이면 전환되는 조건이라서, 크기가 0.8에 세로선 표시되는 수식은 표시가 안됩니다.
전환 조건과 같은 크기의(0.8) 세로선도 표시되게 부탁드립니다.