커뮤니티

추세선 직전고저점

프로필 이미지
고성
2025-02-09 14:47:59
505
글번호 187956
답변완료
input : Period(130); Var:j(0),T(0),tx(0),tx1(0),box(0),TL(0),upt(0),dnt(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(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]; Text_Delete(dnt); var1 = loval[0]-loval[1]; dnt = Text_New(date12,time12,value12,NewLine+NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(dnt,iff(var1>0,Magenta,Blue)); Text_SetStyle(dnt,1,2); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Condition1 = False; box = Box_New(date11,time11,Value11,date12,time12,Value12); if abs(value12[1]-value11[1]) < 0.8 Then Text_Delete(tx); tx = Text_New(sDate,stime,value12,NumToStr(value11-value12,2)); Text_SetColor(Tx,Blue); Text_SetStyle(tx,1,0); Text_SetSize(tx,25); Text_SetBold(tx,1); } 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,Magenta,Blue)); Text_SetStyle(dnt,1,2); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Box_SetEnd(box,date12,time12,Value12); Text_SetString(tx,NumToStr(value11-value12,2)); Text_SetLocation(tx,sDate,sTime,value12); } if value12 > value11-0.5 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,90); } else if value12 <= value11-0.5 and value12 > value11-0.7 Then { Box_SetColor(box,Blue); Box_SetFill(box,true,50); } else if value12 <= value11-0.7 and value12 > value11-0.8 Then { Box_SetColor(box,Yellow); Box_SetFill(box,true,150); } else if value12 <= value11-0.8 and value12 > value11-1.2 Then { Box_SetColor(box,Lime); Box_SetFill(box,true,80); } else if value12 <= value11-1.2 and value12 > value11-1.6 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,80); } else if value12 <= value11-1.6 and value12 > value11-1.9 Then { Box_SetColor(box,Blue); Box_SetFill(box,true,30); } else { Box_SetColor(box,Yellow); Box_SetFill(box,true,80); } if Condition1 == False and hival[0] < hival[1] and hival[1] < hival[2] and Loval[0] < loval[1] and Loval[1] < loval[2] Then { Condition1 = true; tx1 = Text_New(sDate,sTime,L+0.6,"●"); Text_SetStyle(tx1,2,2); Text_SetColor(tx1,Red); Text_SetSize(tx1,40); Sell(); } } 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]; date31 = date[LoBar[0]]; time31 = stime[LoBar[0]]; date32 = date[0]; time32 = stime[0]; 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,Magenta,Blue)); Text_SetStyle(upt,1,2); Text_SetSize(upt,35); Text_SetBold(upt,1); Condition2 = False; box = Box_New(date11,time11,Value11,date12,time12,Value12); if abs(value12[1]-value11[1]) < 0.8 Then Text_Delete(tx); tx = Text_New(sDate,stime,value12,NumToStr(value12-value11,2)); Text_SetColor(Tx,Red); Text_SetStyle(tx,1,1); Text_SetSize(tx,25); Text_SetBold(tx,1); } 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,Magenta,Blue)); Text_SetStyle(upt,1,2); Text_SetSize(upt,35); Text_SetBold(upt,1); Box_SetEnd(box,date12,time12,Value12); Text_SetString(tx,NumToStr(value12-value11,2)); Text_SetLocation(tx,sDate,sTime,value12); } if Value12 >= value11+1.9 Then { Box_SetColor(box,Pink); Box_SetFill(box,true,70); } else if value12 >= value11+1.2 and value12 < value11+1.9 Then { Box_SetColor(box,Gray); Box_SetFill(box,true,60); } else if value12 >= value11+0.8 and value12 < value11+1.2 Then { Box_SetColor(box,Magenta); Box_SetFill(box,true,40); } else if value12 >= value11+0.5 and value12 < value11+0.8 Then { Box_SetColor(box,Orange); Box_SetFill(box,true,100); } Else { Box_SetColor(box,Gold); Box_SetFill(box,true,150); } if Condition2 == False and loval[0] > loval[1] and loval[1] > loval[2] and hival[0] > hival[1] and hival[1] > hival[2] Then { Condition2 = true; tx1 = Text_New(sDate,sTime,H-0.6,"●"); Text_SetStyle(tx1,2,2); Text_SetColor(tx1,Blue); Text_SetSize(tx1,40); Sell(); } } if MarketPosition == 1 and BarsSinceEntry == 1 Then ExitLong(); if MarketPosition == -1 and BarsSinceEntry == 1 Then ExitShort(); a.하락하는 주가가 직전 하락추세선의 저점에서 +2틱에서 -3틱 사이에 있으면 세로선 표시. 벗어나거나 양전환되면 삭제. 일시적으로 벗어났다 들어오면 다시 표시. 상승하는 주가가 직전 상승추세선의 고점에서 -2틱에서 +3틱 사이에 있으면 세로선 표시. 벗어나거나 음전환되면 삭제. (쌍바닥 쌍봉 위치 표시) b.직전 고저점과의 차이를 틱수로 표시하는 부분을, (abs(var1/PriceScale),0) 단순 수치로 수정. (5틱을 0.25로). 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-02-10 16:06:14

안녕하세요 예스스탁입니다. input : Period(130); Var:j(0),T(0),tx(0),tx1(0),box(0),TL(0),upt(0),dnt(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),tl1(0),tl2(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(C,highest(H,Period)[1]) Then T = 1; if CrossDown(C,Lowest(L,Period)[1]) Then T = -1; If T == -1 Then { TL_Delete(tl2); 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]; Text_Delete(dnt); var1 = loval[0]-loval[1]; dnt = Text_New(date12,time12,value12,NewLine+NumToStr(abs(var1),2)+" "+NewLine); Text_SetColor(dnt,iff(var1>0,Magenta,Blue)); Text_SetStyle(dnt,1,2); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Condition1 = False; box = Box_New(date11,time11,Value11,date12,time12,Value12); if abs(value12[1]-value11[1]) < 0.8 Then Text_Delete(tx); tx = Text_New(sDate,stime,value12,NumToStr(value11-value12,2)); Text_SetColor(Tx,Blue); Text_SetStyle(tx,1,0); Text_SetSize(tx,25); Text_SetBold(tx,1); } 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),2)+" "); Text_SetColor(dnt,iff(var1>0,Magenta,Blue)); Text_SetStyle(dnt,1,2); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Box_SetEnd(box,date12,time12,Value12); Text_SetString(tx,NumToStr(value11-value12,2)); Text_SetLocation(tx,sDate,sTime,value12); } if value12 > value11-0.5 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,90); } else if value12 <= value11-0.5 and value12 > value11-0.7 Then { Box_SetColor(box,Blue); Box_SetFill(box,true,50); } else if value12 <= value11-0.7 and value12 > value11-0.8 Then { Box_SetColor(box,Yellow); Box_SetFill(box,true,150); } else if value12 <= value11-0.8 and value12 > value11-1.2 Then { Box_SetColor(box,Lime); Box_SetFill(box,true,80); } else if value12 <= value11-1.2 and value12 > value11-1.6 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,80); } else if value12 <= value11-1.6 and value12 > value11-1.9 Then { Box_SetColor(box,Blue); Box_SetFill(box,true,30); } else { Box_SetColor(box,Yellow); Box_SetFill(box,true,80); } if Condition1 == False and hival[0] < hival[1] and hival[1] < hival[2] and Loval[0] < loval[1] and Loval[1] < loval[2] Then { Condition1 = true; tx1 = Text_New(sDate,sTime,L+0.6,"●"); Text_SetStyle(tx1,2,2); Text_SetColor(tx1,Red); Text_SetSize(tx1,40); Sell(); } TL_Delete(tl1); if C <= Loval[1]+PriceScale*2 and C >= loval[1]-PriceScale*3 Then { tl1 = TL_New(sDate,sTime,0,sDate,sTime,999999999); } } If T == 1 Then { If T[1] != 1 Then { TL_Delete(tl1); 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]; Text_Delete(upt); var1 = hival[0]-hival[1]; upt = Text_New(date12,time12,value12,NumToStr(abs(var1),2)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Magenta,Blue)); Text_SetStyle(upt,1,2); Text_SetSize(upt,35); Text_SetBold(upt,1); Condition2 = False; box = Box_New(date11,time11,Value11,date12,time12,Value12); if abs(value12[1]-value11[1]) < 0.8 Then Text_Delete(tx); tx = Text_New(sDate,stime,value12,NumToStr(value12-value11,2)); Text_SetColor(Tx,Red); Text_SetStyle(tx,1,1); Text_SetSize(tx,25); Text_SetBold(tx,1); } 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),2)+" "+NewLine); Text_SetColor(upt,iff(var1>0,Magenta,Blue)); Text_SetStyle(upt,1,2); Text_SetSize(upt,35); Text_SetBold(upt,1); Box_SetEnd(box,date12,time12,Value12); Text_SetString(tx,NumToStr(value12-value11,2)); Text_SetLocation(tx,sDate,sTime,value12); } if Value12 >= value11+1.9 Then { Box_SetColor(box,Pink); Box_SetFill(box,true,70); } else if value12 >= value11+1.2 and value12 < value11+1.9 Then { Box_SetColor(box,Gray); Box_SetFill(box,true,60); } else if value12 >= value11+0.8 and value12 < value11+1.2 Then { Box_SetColor(box,Magenta); Box_SetFill(box,true,40); } else if value12 >= value11+0.5 and value12 < value11+0.8 Then { Box_SetColor(box,Orange); Box_SetFill(box,true,100); } Else { Box_SetColor(box,Gold); Box_SetFill(box,true,150); } if Condition2 == False and loval[0] > loval[1] and loval[1] > loval[2] and hival[0] > hival[1] and hival[1] > hival[2] Then { Condition2 = true; tx1 = Text_New(sDate,sTime,H-0.6,"●"); Text_SetStyle(tx1,2,2); Text_SetColor(tx1,Blue); Text_SetSize(tx1,40); Sell(); } TL_Delete(tl2); if C <= hival[1]+PriceScale*3 and C >= hival[1]-PriceScale*2 Then { tl2 = TL_New(sDate,sTime,0,sDate,sTime,999999999); } } if MarketPosition == 1 and BarsSinceEntry == 1 Then ExitLong(); if MarketPosition == -1 and BarsSinceEntry == 1 Then ExitShort(); 즐거운 하루되세요 > 고성 님이 쓴 글입니다. > 제목 : 추세선 직전고저점 > input : Period(130); Var:j(0),T(0),tx(0),tx1(0),box(0),TL(0),upt(0),dnt(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(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]; Text_Delete(dnt); var1 = loval[0]-loval[1]; dnt = Text_New(date12,time12,value12,NewLine+NumToStr(abs(var1/PriceScale),0)+" "+NewLine); Text_SetColor(dnt,iff(var1>0,Magenta,Blue)); Text_SetStyle(dnt,1,2); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Condition1 = False; box = Box_New(date11,time11,Value11,date12,time12,Value12); if abs(value12[1]-value11[1]) < 0.8 Then Text_Delete(tx); tx = Text_New(sDate,stime,value12,NumToStr(value11-value12,2)); Text_SetColor(Tx,Blue); Text_SetStyle(tx,1,0); Text_SetSize(tx,25); Text_SetBold(tx,1); } 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,Magenta,Blue)); Text_SetStyle(dnt,1,2); Text_SetSize(dnt,35); Text_SetBold(dnt,1); Box_SetEnd(box,date12,time12,Value12); Text_SetString(tx,NumToStr(value11-value12,2)); Text_SetLocation(tx,sDate,sTime,value12); } if value12 > value11-0.5 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,90); } else if value12 <= value11-0.5 and value12 > value11-0.7 Then { Box_SetColor(box,Blue); Box_SetFill(box,true,50); } else if value12 <= value11-0.7 and value12 > value11-0.8 Then { Box_SetColor(box,Yellow); Box_SetFill(box,true,150); } else if value12 <= value11-0.8 and value12 > value11-1.2 Then { Box_SetColor(box,Lime); Box_SetFill(box,true,80); } else if value12 <= value11-1.2 and value12 > value11-1.6 Then { Box_SetColor(box,Cyan); Box_SetFill(box,true,80); } else if value12 <= value11-1.6 and value12 > value11-1.9 Then { Box_SetColor(box,Blue); Box_SetFill(box,true,30); } else { Box_SetColor(box,Yellow); Box_SetFill(box,true,80); } if Condition1 == False and hival[0] < hival[1] and hival[1] < hival[2] and Loval[0] < loval[1] and Loval[1] < loval[2] Then { Condition1 = true; tx1 = Text_New(sDate,sTime,L+0.6,"●"); Text_SetStyle(tx1,2,2); Text_SetColor(tx1,Red); Text_SetSize(tx1,40); Sell(); } } 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]; date31 = date[LoBar[0]]; time31 = stime[LoBar[0]]; date32 = date[0]; time32 = stime[0]; 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,Magenta,Blue)); Text_SetStyle(upt,1,2); Text_SetSize(upt,35); Text_SetBold(upt,1); Condition2 = False; box = Box_New(date11,time11,Value11,date12,time12,Value12); if abs(value12[1]-value11[1]) < 0.8 Then Text_Delete(tx); tx = Text_New(sDate,stime,value12,NumToStr(value12-value11,2)); Text_SetColor(Tx,Red); Text_SetStyle(tx,1,1); Text_SetSize(tx,25); Text_SetBold(tx,1); } 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,Magenta,Blue)); Text_SetStyle(upt,1,2); Text_SetSize(upt,35); Text_SetBold(upt,1); Box_SetEnd(box,date12,time12,Value12); Text_SetString(tx,NumToStr(value12-value11,2)); Text_SetLocation(tx,sDate,sTime,value12); } if Value12 >= value11+1.9 Then { Box_SetColor(box,Pink); Box_SetFill(box,true,70); } else if value12 >= value11+1.2 and value12 < value11+1.9 Then { Box_SetColor(box,Gray); Box_SetFill(box,true,60); } else if value12 >= value11+0.8 and value12 < value11+1.2 Then { Box_SetColor(box,Magenta); Box_SetFill(box,true,40); } else if value12 >= value11+0.5 and value12 < value11+0.8 Then { Box_SetColor(box,Orange); Box_SetFill(box,true,100); } Else { Box_SetColor(box,Gold); Box_SetFill(box,true,150); } if Condition2 == False and loval[0] > loval[1] and loval[1] > loval[2] and hival[0] > hival[1] and hival[1] > hival[2] Then { Condition2 = true; tx1 = Text_New(sDate,sTime,H-0.6,"●"); Text_SetStyle(tx1,2,2); Text_SetColor(tx1,Blue); Text_SetSize(tx1,40); Sell(); } } if MarketPosition == 1 and BarsSinceEntry == 1 Then ExitLong(); if MarketPosition == -1 and BarsSinceEntry == 1 Then ExitShort(); a.하락하는 주가가 직전 하락추세선의 저점에서 +2틱에서 -3틱 사이에 있으면 세로선 표시. 벗어나거나 양전환되면 삭제. 일시적으로 벗어났다 들어오면 다시 표시. 상승하는 주가가 직전 상승추세선의 고점에서 -2틱에서 +3틱 사이에 있으면 세로선 표시. 벗어나거나 음전환되면 삭제. (쌍바닥 쌍봉 위치 표시) b.직전 고저점과의 차이를 틱수로 표시하는 부분을, (abs(var1/PriceScale),0) 단순 수치로 수정. (5틱을 0.25로). 감사합니다.