커뮤니티

지표식 문의 드립니다.

프로필 이미지
키드
2019-09-21 15:43:43
174
글번호 132135
답변완료
제가 원하는 지표는 "특정시간부터 특정시간까지"의 "저점과 고점"의 사각박스를 만드는 지표를 부탁드립니다. 박스 1,2,3 고점과 저점을 사각박스로 만들어 지면 좋겠습니다. 박스1 = 07:00~12:00 박스2 = 17:00~22:00 박스3 = 23:00~04:00 감사합니다!
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-09-24 10:26:55

안녕하세요 예스스탁입니다. 가장 최근 지정한 시간대만 사각박스가 그려지게 작성해 드립니다. input : s1(070000),e1(120000); input : s2(170000),e2(220000); input : s3(230000),e3(040000); var : d1(0),t1(0),h1(0),l1(0),tl11(0),tl12(0),tl13(0),tl14(0); var : d2(0),t2(0),h2(0),l2(0),tl21(0),tl22(0),tl23(0),tl24(0); var : d3(0),t3(0),h3(0),l3(0),tl31(0),tl32(0),tl33(0),tl34(0); if (sdate != sdate[1] and stime >= e1) or (sdate == sdate[1] and stime >= e1 and stime[1] < e1) then Condition1 = false; if (sdate != sdate[1] and stime >= s1) or (sdate == sdate[1] and stime >= s1 and stime[1] < s1) then { Condition1 = true; d1 = sdate; t1 = stime; h1 = h; l1 = l; } if Condition1 == true then { if h > h1 Then h1 = h; if l < l1 Then l1 = l; TL_Delete(tl11); TL_Delete(tl12); TL_Delete(tl13); TL_Delete(tl14); tl11 = TL_New(d1,t1,h1,d1,t1,l1); tl12 = TL_New(d1,t1,h1,sdate,stime,h1); tl13 = TL_New(d1,t1,l1,sdate,stime,l1); tl14 = TL_New(sdate,stime,h1,sdate,stime,l1); TL_SetColor(tl11,RED); TL_SetColor(tl12,RED); TL_SetColor(tl13,RED); TL_SetColor(tl14,RED); } if (sdate != sdate[1] and stime >= e2) or (sdate == sdate[1] and stime >= e2 and stime[1] < e2) then Condition2 = false; if (sdate != sdate[1] and stime >= s2) or (sdate == sdate[1] and stime >= s2 and stime[1] < s2) then { Condition2 = true; d2 = sdate; t2 = stime; h2 = h; l2 = l; } if Condition2 == true then { if h > h2 Then h2 = h; if l < l2 Then l2 = l; TL_Delete(tl21); TL_Delete(tl22); TL_Delete(tl23); TL_Delete(tl24); tl21 = TL_New(d2,t2,h2,d2,t2,l2); tl22 = TL_New(d2,t2,h2,sdate,stime,h2); tl23 = TL_New(d2,t2,l2,sdate,stime,l2); tl24 = TL_New(sdate,stime,h2,sdate,stime,l2); TL_SetColor(tl21,BLUE); TL_SetColor(tl22,BLUE); TL_SetColor(tl23,BLUE); TL_SetColor(tl24,BLUE); } if (sdate != sdate[1] and stime >= e3) or (sdate == sdate[1] and stime >= e3 and stime[1] < e3) then Condition3 = false; if (sdate != sdate[1] and stime >= s3) or (sdate == sdate[1] and stime >= s3 and stime[1] < s3) then { Condition3 = true; d3 = sdate; t3 = stime; h3 = h; l3 = l; } if Condition3 == true then { if h > h3 Then h3 = h; if l < l3 Then l3 = l; TL_Delete(tl31); TL_Delete(tl32); TL_Delete(tl33); TL_Delete(tl34); tl31 = TL_New(d3,t3,h3,d3,t3,l3); tl32 = TL_New(d3,t3,h3,sdate,stime,h3); tl33 = TL_New(d3,t3,l3,sdate,stime,l3); tl34 = TL_New(sdate,stime,h3,sdate,stime,l3); TL_SetColor(tl31,GREEN); TL_SetColor(tl32,GREEN); TL_SetColor(tl33,GREEN); TL_SetColor(tl34,GREEN); } 즐거운 하루되세요 > 키드 님이 쓴 글입니다. > 제목 : 지표식 문의 드립니다. > 제가 원하는 지표는 "특정시간부터 특정시간까지"의 "저점과 고점"의 사각박스를 만드는 지표를 부탁드립니다. 박스 1,2,3 고점과 저점을 사각박스로 만들어 지면 좋겠습니다. 박스1 = 07:00~12:00 박스2 = 17:00~22:00 박스3 = 23:00~04:00 감사합니다!