커뮤니티

박스 보관

프로필 이미지
고성
2023-02-19 17:39:23
1276
글번호 166439
답변완료
input : Period(120),틱1(4),틱2(5); Var:j(0),T(0); Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),tl9(0), date21(0),date22(0),time21(0),time22(0),txx(0), vTL(0), vTL9(0),txxx(0), date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0),tx4(0); Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0); var : upt(0),dnt(0),box(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]; Condition3 = False; if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4=Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetStyle(tx4,2,2); Text_SetColor(tx4,Black); Text_SetSize(tx4,35); } Txx = Text_New(date11,time11,loval[0]-PriceScale*8,"●"); Condition99 = true; Text_SetColor(Txx,Red); Text_SetStyle(Txx,2,2); Text_SetSize(txx,30); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } Text_Delete(dnt); var1 = loval[0]-loval[1]; dnt = Text_New(date12,time12,value12,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Box_Delete(box); Condition88 = False; if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Lime); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } 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]; var1 = loval[0]-loval[1]; Text_SetLocation(dnt,date12,time12,value12); Text_SetString(dnt,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Lime); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } Box_SetEnd(box,NextBarSdate,NextBarStime,L); if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4 =Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetColor(Tx4,Black); Text_SetStyle(tx4,2,2); Text_SetSize(tx4,35); } TL_Delete(tl); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } } } If T == 1 Then { If T[1] != 1 Then { if Condition3 == true Then Text_Delete(tx4); 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 Condition99 == true and Loval[0] >= Loval[1]-PriceScale*틱1 Then { Condition99 = False; Text_Delete(txx); } Text_Delete(upt); var1 = hival[0]-hival[1]; upt = Text_New(date12,time12,value12,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); Box_Delete(box); Condition88 = False; if Condition88 ==False Then { if value12 >= value11+0.85 Then { Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Magenta); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } Else { 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]; var1 = hival[0]-hival[1]; Text_SetLocation(upt,date12,time12,value12); Text_SetString(upt,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); if Condition88 == False Then { if value12 >= value11+0.85 Then { Condition88 = true; Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Magenta); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } Box_SetEnd(box,date12,time12,Value12); } } 상승추세선에서 발생한 박스는 현재 수식과 같이 음전환시 삭제로 동일하고, 하락추세선에서 양전환될 때 박스 삭제하는 부분만 양전환시 삭제에서 저장으로 변경. 박스 시작점과 끝 지점(전환될 때까지만 표시)은 지금과 동일. 이후에도 상승추세선에서 생성된 박스는 음전환시 항상 삭제하고, 새로운 하락추세선에서 박스 생성되면 모두 저장. 감사합니다.
지표
답변 3
프로필 이미지

예스스탁 예스스탁 답변

2023-02-20 11:24:02

안녕하세요 예스스탁입니다. input : Period(120),틱1(4),틱2(5); Var:j(0),T(0); Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),tl9(0), date21(0),date22(0),time21(0),time22(0),txx(0), vTL(0), vTL9(0),txxx(0), date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0),tx4(0); Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0); var : upt(0),dnt(0),box1(0),box2(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 { Box_Delete(box2); 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]; Condition3 = False; if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4=Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetStyle(tx4,2,2); Text_SetColor(tx4,Black); Text_SetSize(tx4,35); } Txx = Text_New(date11,time11,loval[0]-PriceScale*8,"●"); Condition99 = true; Text_SetColor(Txx,Red); Text_SetStyle(Txx,2,2); Text_SetSize(txx,30); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } Text_Delete(dnt); var1 = loval[0]-loval[1]; dnt = Text_New(date12,time12,value12,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Condition88 = False; if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box1 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box1,Lime); Box_SetFill(box1,true,30); Box_SetExtFill(box1,true); } } } 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]; var1 = loval[0]-loval[1]; Text_SetLocation(dnt,date12,time12,value12); Text_SetString(dnt,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box1 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box1,Lime); Box_SetFill(box1,true,30); Box_SetExtFill(box1,true); } } } Box_SetEnd(box1,NextBarSdate,NextBarStime,L); if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4 =Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetColor(Tx4,Black); Text_SetStyle(tx4,2,2); Text_SetSize(tx4,35); } TL_Delete(tl); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } } } If T == 1 Then { If T[1] != 1 Then { if Condition3 == true Then Text_Delete(tx4); 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 Condition99 == true and Loval[0] >= Loval[1]-PriceScale*틱1 Then { Condition99 = False; Text_Delete(txx); } Text_Delete(upt); var1 = hival[0]-hival[1]; upt = Text_New(date12,time12,value12,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); Condition88 = False; if Condition88 ==False Then { if value12 >= value11+0.85 Then { Condition88 = true; box2 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box2,Magenta); Box_SetFill(box2,true,30); Box_SetExtFill(box2,true); } } } Else { 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]; var1 = hival[0]-hival[1]; Text_SetLocation(upt,date12,time12,value12); Text_SetString(upt,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); if Condition88 == False Then { if value12 >= value11+0.85 Then { Condition88 = true; Condition88 = true; box2 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box2,Magenta); Box_SetFill(box2,true,30); Box_SetExtFill(box2,true); } } } Box_SetEnd(box2,NextBarSdate,NextBarStime,L); } } 즐거운 하루되세요 > 고성 님이 쓴 글입니다. > 제목 : 박스 보관 > input : Period(120),틱1(4),틱2(5); Var:j(0),T(0); Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),tl9(0), date21(0),date22(0),time21(0),time22(0),txx(0), vTL(0), vTL9(0),txxx(0), date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0),tx4(0); Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0); var : upt(0),dnt(0),box(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]; Condition3 = False; if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4=Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetStyle(tx4,2,2); Text_SetColor(tx4,Black); Text_SetSize(tx4,35); } Txx = Text_New(date11,time11,loval[0]-PriceScale*8,"●"); Condition99 = true; Text_SetColor(Txx,Red); Text_SetStyle(Txx,2,2); Text_SetSize(txx,30); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } Text_Delete(dnt); var1 = loval[0]-loval[1]; dnt = Text_New(date12,time12,value12,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Box_Delete(box); Condition88 = False; if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Lime); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } 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]; var1 = loval[0]-loval[1]; Text_SetLocation(dnt,date12,time12,value12); Text_SetString(dnt,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Lime); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } Box_SetEnd(box,NextBarSdate,NextBarStime,L); if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4 =Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetColor(Tx4,Black); Text_SetStyle(tx4,2,2); Text_SetSize(tx4,35); } TL_Delete(tl); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } } } If T == 1 Then { If T[1] != 1 Then { if Condition3 == true Then Text_Delete(tx4); 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 Condition99 == true and Loval[0] >= Loval[1]-PriceScale*틱1 Then { Condition99 = False; Text_Delete(txx); } Text_Delete(upt); var1 = hival[0]-hival[1]; upt = Text_New(date12,time12,value12,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); Box_Delete(box); Condition88 = False; if Condition88 ==False Then { if value12 >= value11+0.85 Then { Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Magenta); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } Else { 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]; var1 = hival[0]-hival[1]; Text_SetLocation(upt,date12,time12,value12); Text_SetString(upt,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); if Condition88 == False Then { if value12 >= value11+0.85 Then { Condition88 = true; Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Magenta); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } Box_SetEnd(box,date12,time12,Value12); } } 상승추세선에서 발생한 박스는 현재 수식과 같이 음전환시 삭제로 동일하고, 하락추세선에서 양전환될 때 박스 삭제하는 부분만 양전환시 삭제에서 저장으로 변경. 박스 시작점과 끝 지점(전환될 때까지만 표시)은 지금과 동일. 이후에도 상승추세선에서 생성된 박스는 음전환시 항상 삭제하고, 새로운 하락추세선에서 박스 생성되면 모두 저장. 감사합니다.
프로필 이미지

고성

2023-02-20 12:44:46

> 예스스탁 님이 쓴 글입니다. > 제목 : Re : 박스 보관 > 안녕하세요 예스스탁입니다. input : Period(120),틱1(4),틱2(5); Var:j(0),T(0); Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),tl9(0), date21(0),date22(0),time21(0),time22(0),txx(0), vTL(0), vTL9(0),txxx(0), date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0),tx4(0); Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0); var : upt(0),dnt(0),box1(0),box2(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 { Box_Delete(box2); 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]; Condition3 = False; if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4=Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetStyle(tx4,2,2); Text_SetColor(tx4,Black); Text_SetSize(tx4,35); } Txx = Text_New(date11,time11,loval[0]-PriceScale*8,"●"); Condition99 = true; Text_SetColor(Txx,Red); Text_SetStyle(Txx,2,2); Text_SetSize(txx,30); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } Text_Delete(dnt); var1 = loval[0]-loval[1]; dnt = Text_New(date12,time12,value12,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Condition88 = False; if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box1 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box1,Lime); Box_SetFill(box1,true,30); Box_SetExtFill(box1,true); } } } 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]; var1 = loval[0]-loval[1]; Text_SetLocation(dnt,date12,time12,value12); Text_SetString(dnt,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box1 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box1,Lime); Box_SetFill(box1,true,30); Box_SetExtFill(box1,true); } } } Box_SetEnd(box1,NextBarSdate,NextBarStime,L); if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4 =Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetColor(Tx4,Black); Text_SetStyle(tx4,2,2); Text_SetSize(tx4,35); } TL_Delete(tl); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } } } If T == 1 Then { If T[1] != 1 Then { if Condition3 == true Then Text_Delete(tx4); 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 Condition99 == true and Loval[0] >= Loval[1]-PriceScale*틱1 Then { Condition99 = False; Text_Delete(txx); } Text_Delete(upt); var1 = hival[0]-hival[1]; upt = Text_New(date12,time12,value12,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); Condition88 = False; if Condition88 ==False Then { if value12 >= value11+0.85 Then { Condition88 = true; box2 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box2,Magenta); Box_SetFill(box2,true,30); Box_SetExtFill(box2,true); } } } Else { 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]; var1 = hival[0]-hival[1]; Text_SetLocation(upt,date12,time12,value12); Text_SetString(upt,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); if Condition88 == False Then { if value12 >= value11+0.85 Then { Condition88 = true; Condition88 = true; box2 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box2,Magenta); Box_SetFill(box2,true,30); Box_SetExtFill(box2,true); } } } Box_SetEnd(box2,NextBarSdate,NextBarStime,L); } } 즐거운 하루되세요 > 고성 님이 쓴 글입니다. > 제목 : 박스 보관 > input : Period(120),틱1(4),틱2(5); Var:j(0),T(0); Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),tl9(0), date21(0),date22(0),time21(0),time22(0),txx(0), vTL(0), vTL9(0),txxx(0), date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0),tx4(0); Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0); var : upt(0),dnt(0),box(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]; Condition3 = False; if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4=Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetStyle(tx4,2,2); Text_SetColor(tx4,Black); Text_SetSize(tx4,35); } Txx = Text_New(date11,time11,loval[0]-PriceScale*8,"●"); Condition99 = true; Text_SetColor(Txx,Red); Text_SetStyle(Txx,2,2); Text_SetSize(txx,30); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } Text_Delete(dnt); var1 = loval[0]-loval[1]; dnt = Text_New(date12,time12,value12,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Box_Delete(box); Condition88 = False; if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Lime); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } 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]; var1 = loval[0]-loval[1]; Text_SetLocation(dnt,date12,time12,value12); Text_SetString(dnt,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Lime); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } Box_SetEnd(box,NextBarSdate,NextBarStime,L); if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4 =Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetColor(Tx4,Black); Text_SetStyle(tx4,2,2); Text_SetSize(tx4,35); } TL_Delete(tl); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } } } If T == 1 Then { If T[1] != 1 Then { if Condition3 == true Then Text_Delete(tx4); 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 Condition99 == true and Loval[0] >= Loval[1]-PriceScale*틱1 Then { Condition99 = False; Text_Delete(txx); } Text_Delete(upt); var1 = hival[0]-hival[1]; upt = Text_New(date12,time12,value12,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); Box_Delete(box); Condition88 = False; if Condition88 ==False Then { if value12 >= value11+0.85 Then { Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Magenta); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } Else { 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]; var1 = hival[0]-hival[1]; Text_SetLocation(upt,date12,time12,value12); Text_SetString(upt,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); if Condition88 == False Then { if value12 >= value11+0.85 Then { Condition88 = true; Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Magenta); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } Box_SetEnd(box,date12,time12,Value12); } } 상승추세선에서 발생한 박스는 현재 수식과 같이 음전환시 삭제로 동일하고, 하락추세선에서 양전환될 때 박스 삭제하는 부분만 양전환시 삭제에서 저장으로 변경. 박스 시작점과 끝 지점(전환될 때까지만 표시)은 지금과 동일. 이후에도 상승추세선에서 생성된 박스는 음전환시 항상 삭제하고, 새로운 하락추세선에서 박스 생성되면 모두 저장. 감사합니다. 재문의 박스가 양전환된 후에도 계속 연장되어 표시된후 저장됩니다. 하락추세선에서 발생한 박스는 그 하락추세선의 하단까지만 표시후 저장으로 수정 부탁드립니다. 양전환되면 일단은 종료되고, 새로운 하락추세선에서 박스가 새로 발생하면 또 새로이 저장. 하락추세선의 크기가 0.9p 이상이면 모두 저장되는 박스가 생성됩니다. 감사합니다.
프로필 이미지

예스스탁 예스스탁 답변

2023-02-20 13:51:44

안녕하세요 예스스탁입니다. input : Period(120),틱1(4),틱2(5); Var:j(0),T(0); Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),tl9(0), date21(0),date22(0),time21(0),time22(0),txx(0), vTL(0), vTL9(0),txxx(0), date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0),tx4(0); Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0); var : upt(0),dnt(0),box1(0),box2(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 { Box_Delete(box2); 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]; Condition3 = False; if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4=Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetStyle(tx4,2,2); Text_SetColor(tx4,Black); Text_SetSize(tx4,35); } Txx = Text_New(date11,time11,loval[0]-PriceScale*8,"●"); Condition99 = true; Text_SetColor(Txx,Red); Text_SetStyle(Txx,2,2); Text_SetSize(txx,30); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } Text_Delete(dnt); var1 = loval[0]-loval[1]; dnt = Text_New(date12,time12,value12,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Condition88 = False; if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box1 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box1,Lime); Box_SetFill(box1,true,30); Box_SetExtFill(box1,true); } } } 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]; var1 = loval[0]-loval[1]; Text_SetLocation(dnt,date12,time12,value12); Text_SetString(dnt,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box1 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box1,Lime); Box_SetFill(box1,true,30); Box_SetExtFill(box1,true); } } } if Condition88 == true Then Box_SetEnd(box1,date12,time12,L); if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4 =Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetColor(Tx4,Black); Text_SetStyle(tx4,2,2); Text_SetSize(tx4,35); } TL_Delete(tl); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } } } If T == 1 Then { If T[1] != 1 Then { if Condition3 == true Then Text_Delete(tx4); 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 Condition99 == true and Loval[0] >= Loval[1]-PriceScale*틱1 Then { Condition99 = False; Text_Delete(txx); } Text_Delete(upt); var1 = hival[0]-hival[1]; upt = Text_New(date12,time12,value12,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); Condition99 = False; if Condition99 ==False Then { if value12 >= value11+0.85 Then { Condition99 = true; box2 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box2,Magenta); Box_SetFill(box2,true,30); Box_SetExtFill(box2,true); } } } Else { 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]; var1 = hival[0]-hival[1]; Text_SetLocation(upt,date12,time12,value12); Text_SetString(upt,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); if Condition99 == False Then { if value12 >= value11+0.85 Then { Condition99 = true; box2 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box2,Magenta); Box_SetFill(box2,true,30); Box_SetExtFill(box2,true); } } } if Condition99 == true Then Box_SetEnd(box2,date12,time12,Value12); } } 즐거운 하루되세요 > 고성 님이 쓴 글입니다. > 제목 : Re : Re : 박스 보관 > > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 박스 보관 > 안녕하세요 예스스탁입니다. input : Period(120),틱1(4),틱2(5); Var:j(0),T(0); Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),tl9(0), date21(0),date22(0),time21(0),time22(0),txx(0), vTL(0), vTL9(0),txxx(0), date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0),tx4(0); Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0); var : upt(0),dnt(0),box1(0),box2(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 { Box_Delete(box2); 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]; Condition3 = False; if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4=Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetStyle(tx4,2,2); Text_SetColor(tx4,Black); Text_SetSize(tx4,35); } Txx = Text_New(date11,time11,loval[0]-PriceScale*8,"●"); Condition99 = true; Text_SetColor(Txx,Red); Text_SetStyle(Txx,2,2); Text_SetSize(txx,30); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } Text_Delete(dnt); var1 = loval[0]-loval[1]; dnt = Text_New(date12,time12,value12,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Condition88 = False; if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box1 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box1,Lime); Box_SetFill(box1,true,30); Box_SetExtFill(box1,true); } } } 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]; var1 = loval[0]-loval[1]; Text_SetLocation(dnt,date12,time12,value12); Text_SetString(dnt,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box1 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box1,Lime); Box_SetFill(box1,true,30); Box_SetExtFill(box1,true); } } } Box_SetEnd(box1,NextBarSdate,NextBarStime,L); if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4 =Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetColor(Tx4,Black); Text_SetStyle(tx4,2,2); Text_SetSize(tx4,35); } TL_Delete(tl); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } } } If T == 1 Then { If T[1] != 1 Then { if Condition3 == true Then Text_Delete(tx4); 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 Condition99 == true and Loval[0] >= Loval[1]-PriceScale*틱1 Then { Condition99 = False; Text_Delete(txx); } Text_Delete(upt); var1 = hival[0]-hival[1]; upt = Text_New(date12,time12,value12,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); Condition88 = False; if Condition88 ==False Then { if value12 >= value11+0.85 Then { Condition88 = true; box2 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box2,Magenta); Box_SetFill(box2,true,30); Box_SetExtFill(box2,true); } } } Else { 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]; var1 = hival[0]-hival[1]; Text_SetLocation(upt,date12,time12,value12); Text_SetString(upt,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); if Condition88 == False Then { if value12 >= value11+0.85 Then { Condition88 = true; Condition88 = true; box2 = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box2,Magenta); Box_SetFill(box2,true,30); Box_SetExtFill(box2,true); } } } Box_SetEnd(box2,NextBarSdate,NextBarStime,L); } } 즐거운 하루되세요 > 고성 님이 쓴 글입니다. > 제목 : 박스 보관 > input : Period(120),틱1(4),틱2(5); Var:j(0),T(0); Var: date11(0),date12(0),time11(0),time12(0),TL1(0),TL(0),tl9(0), date21(0),date22(0),time21(0),time22(0),txx(0), vTL(0), vTL9(0),txxx(0), date31(0),date32(0),time31(0),time32(0),tx(0),tx1(0),tl4(0),tx4(0); Array:HiVal[20](0),LoVal[20](0),HiBar[20](0),LoBar[20](0); var : upt(0),dnt(0),box(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]; Condition3 = False; if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4=Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetStyle(tx4,2,2); Text_SetColor(tx4,Black); Text_SetSize(tx4,35); } Txx = Text_New(date11,time11,loval[0]-PriceScale*8,"●"); Condition99 = true; Text_SetColor(Txx,Red); Text_SetStyle(Txx,2,2); Text_SetSize(txx,30); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } Text_Delete(dnt); var1 = loval[0]-loval[1]; dnt = Text_New(date12,time12,value12,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Box_Delete(box); Condition88 = False; if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Lime); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } 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]; var1 = loval[0]-loval[1]; Text_SetLocation(dnt,date12,time12,value12); Text_SetString(dnt,NewLine+NumToStr(abs(var1/PriceScale),0)+" "); Text_SetColor(dnt,iff(var1>0,Red,Blue)); Text_SetStyle(dnt,1,1); Text_SetSize(dnt,35); Text_SetBold(dnt,1); if Condition88 ==False Then { if value12 <= value11-0.85 Then { Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Lime); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } Box_SetEnd(box,NextBarSdate,NextBarStime,L); if Condition3 == False and Value12 <= value11-0.5 and value12 < DayHigh-0.8 Then { Tx4 =Text_New(date11,time11,value11+PriceScale*2,"●"); Condition3 = true; Text_SetColor(Tx4,Black); Text_SetStyle(tx4,2,2); Text_SetSize(tx4,35); } TL_Delete(tl); if Condition99 == true and Loval[0] <= loval[1]-PriceScale*틱2 Then { Condition99 = False; Text_Delete(txx); PlaySound("C:₩예스트레이더₩data₩Sound₩reject.wav"); } } } If T == 1 Then { If T[1] != 1 Then { if Condition3 == true Then Text_Delete(tx4); 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 Condition99 == true and Loval[0] >= Loval[1]-PriceScale*틱1 Then { Condition99 = False; Text_Delete(txx); } Text_Delete(upt); var1 = hival[0]-hival[1]; upt = Text_New(date12,time12,value12,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); Box_Delete(box); Condition88 = False; if Condition88 ==False Then { if value12 >= value11+0.85 Then { Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Magenta); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } Else { 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]; var1 = hival[0]-hival[1]; Text_SetLocation(upt,date12,time12,value12); Text_SetString(upt,NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Red,Blue)); Text_SetStyle(upt,2,0); Text_SetSize(upt,35); Text_SetBold(upt,1); if Condition88 == False Then { if value12 >= value11+0.85 Then { Condition88 = true; Condition88 = true; box = Box_New(date12,time12,H,NextBarSdate,NextBarStime,L); Box_SetColor(box,Magenta); Box_SetFill(box,true,30); Box_SetExtFill(box,true); } } } Box_SetEnd(box,date12,time12,Value12); } } 상승추세선에서 발생한 박스는 현재 수식과 같이 음전환시 삭제로 동일하고, 하락추세선에서 양전환될 때 박스 삭제하는 부분만 양전환시 삭제에서 저장으로 변경. 박스 시작점과 끝 지점(전환될 때까지만 표시)은 지금과 동일. 이후에도 상승추세선에서 생성된 박스는 음전환시 항상 삭제하고, 새로운 하락추세선에서 박스 생성되면 모두 저장. 감사합니다. 재문의 박스가 양전환된 후에도 계속 연장되어 표시된후 저장됩니다. 하락추세선에서 발생한 박스는 그 하락추세선의 하단까지만 표시후 저장으로 수정 부탁드립니다. 양전환되면 일단은 종료되고, 새로운 하락추세선에서 박스가 새로 발생하면 또 새로이 저장. 하락추세선의 크기가 0.9p 이상이면 모두 저장되는 박스가 생성됩니다. 감사합니다.