예스스탁
예스스탁 답변
2023-03-15 10:54:46
안녕하세요
예스스탁입니다.
동그라미 표시시 이전표시된 동그라미를 삭제하게 수정해 드립니다.
input : Period(120);
Var:j(0),T(0),count(0),l1(0),l2(0),l3(0);
Var: date11(0),date12(0),time11(0),time12(0),
date21(0),date22(0),time21(0),time22(0),txx(0),
date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0);
Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0);
Plot1(value12);
For j = 0 To 19
{
HiBar[j] = HiBar[j] + 1;
LoBar[j] = LoBar[j] + 1;
}
if crossup(c,highest(H,Period)[1]) Then
T = 1;
if CrossDown(c,Lowest(L,Period)[1]) 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];
date21 = date[HiBar[0]];
time21 = stime[HiBar[0]];
date22 = date[0];
time22 = stime[0];
Condition1 = False;
Condition11 = False;
count = 0;
}
Else
{
If LoVal[0] >= L Then
{
LoVal[0] = L;
LoBar[0] = 0;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
date22 = date[0];
time22 = stime[0];
if Condition11 == true and value12 < l2-PriceScale*5 Then
Text_Delete(txx);
Condition1 = False;
}
Else
{
if Condition1 == False and Value12 <= value11-0.5 and H >= value12+PriceScale*3 Then
{
Condition1 = true;
count = count+1;
l1 = value12;
l2 = l1[1];
l3 = l2[1];
if count >= 2 and l1 >= l2-PriceScale*5 Then
{
Condition11 = true;
Text_Delete(txx);
txx = Text_New(sdate,sTime,H+PriceScale*5,"●");
Text_SetStyle(txx,2,2);
Text_SetColor(txx,Red);
Text_SetSize(txx,25);
}
}
if Condition11 == true and value12 < l2-PriceScale*5 Then
{
Condition11 = False;
Text_Delete(txx);
}
}
}
}
If T == 1 Then
{
If T[1] != 1 Then
{
Text_Delete(txx);
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];
date31 = date[LoBar[0]];
time31 = stime[LoBar[0]];
date32 = date[0];
time32 = stime[0];
}
If HiVal[0] < H Then
{
HiVal[0] = H;
HiBar[0] = 0;
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
date32 = date[0];
time32 = stime[0];
}
}
즐거운 하루되세요
> 고성 님이 쓴 글입니다.
> 제목 : 표시 삭제
> input : Period(120);
Var:j(0),T(0),count(0),l1(0),l2(0),l3(0);
Var: date11(0),date12(0),time11(0),time12(0),
date21(0),date22(0),time21(0),time22(0),txx(0),
date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0);
Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0);
Plot1(value12);
For j = 0 To 19
{
HiBar[j] = HiBar[j] + 1;
LoBar[j] = LoBar[j] + 1;
}
if crossup(c,highest(H,Period)[1]) Then
T = 1;
if CrossDown(c,Lowest(L,Period)[1]) 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];
date21 = date[HiBar[0]];
time21 = stime[HiBar[0]];
date22 = date[0];
time22 = stime[0];
Condition1 = False;
Condition11 = False;
count = 0;
}
Else
{
If LoVal[0] >= L Then
{
LoVal[0] = L;
LoBar[0] = 0;
date12 = date[LoBar[0]];
time12 = stime[LoBar[0]];
Value12 = LoVal[0];
date22 = date[0];
time22 = stime[0];
if Condition11 == true and value12 < l2-PriceScale*5 Then
Text_Delete(txx);
Condition1 = False;
}
Else
{
if Condition1 == False and Value12 <= value11-0.5 and H >= value12+PriceScale*3 Then
{
Condition1 = true;
count = count+1;
l1 = value12;
l2 = l1[1];
l3 = l2[1];
if count >= 2 and l1 >= l2-PriceScale*5 Then
{
Condition11 = true;
txx = Text_New(sdate,sTime,H+PriceScale*5,"●");
Text_SetStyle(txx,2,2);
Text_SetColor(txx,Red);
Text_SetSize(txx,25);
}
}
if Condition11 == true and value12 < l2-PriceScale*5 Then
{
Condition11 = False;
Text_Delete(txx);
}
}
}
}
If T == 1 Then
{
If T[1] != 1 Then
{
Text_Delete(txx);
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];
date31 = date[LoBar[0]];
time31 = stime[LoBar[0]];
date32 = date[0];
time32 = stime[0];
}
If HiVal[0] < H Then
{
HiVal[0] = H;
HiBar[0] = 0;
date12 = date[HiBar[0]];
time12 = stime[HiBar[0]];
Value12 = HiVal[0];
date32 = date[0];
time32 = stime[0];
}
}
양전환되거나 첫 반등 저점에서 -6틱 도달시, 동그라미 삭제 부분에서,
동그라미가 하나일 때는 잘 되는데, 반등 많은 횡보 구간에서 동그라미가 여러개 생길 경우 마지막 동그라미만 삭제가 되고 이전 것은 저장이 됩니다. 전부 삭제하고 싶습니다.
1방안:다음 동그라미 생기면 동시에 앞 동그라미 삭제.(항상 하나만 존재) (1방안 우선)
2방안:삭제 조건이 되면 일괄 삭제. 등 등. 수정 부탁드립니다.