커뮤니티

부탁 드립니다.

프로필 이미지
yes
2018-09-20 11:16:58
162
글번호 122182
답변완료
도움주심에 깊이 감사 드립니다. 다음 수식은 3일전 종가와 현재가를 비교하여 선을 긋고 있습니다. 이것을 10일전 종가(변수)와 3일전 종가(변수)를 비교하여 10일전에서 3일전 까지 TL,TL1,TL2,TL3,TL4선을 긋고 싶습니다. 미리 경배로 감사 드립니다. input : N(20); var : cnt(0),TL(0),hh(0),hi(0),ll(0),li(0); var : tl1(0),tl2(0),tl3(0),tl4(0); Array : DD[10](0),TT[10](0),ii[10](0); if bdate != bdate[1] Then { ii[0] = 0; for cnt = 1 to 9 { DD[cnt] = DD[cnt-1][1]; TT[cnt] = TT[cnt-1][1]; ii[cnt] = ii[cnt-1][1]; } } DD[0] = bdate; TT[0] = stime; ii[0] = ii[0]+1; TL_Delete(TL); TL_Delete(TL1); TL_Delete(TL2); TL_Delete(TL3); TL_Delete(TL4); if abs(C-DayClose(3)) <= PriceScale*N then { TL = TL_New(DD[3],TT[3],C,DD[0],TT[0],C); hh = h[0]; hi = 0; ll = l[0]; li = 0; for cnt = 0 to (ii[0]+ii[1]+ii[2]-1) { if h[cnt] > hh Then { hh = h[cnt]; hi = cnt; } if l[cnt] < ll Then { ll = l[cnt]; li = cnt; } } TL1 = TL_New(DD[3],TT[3],C,sdate[hi],stime[hi],hh); TL2 = TL_New(sdate[hi],stime[hi],hh,sdate,stime,c); TL3 = TL_New(DD[3],TT[3],C,sdate[li],stime[li],ll); TL4 = TL_New(sdate[li],stime[li],ll,sdate,stime,c); }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-09-20 11:48:59

안녕하세요 예스스탁입니다. input : X1(3),X2(10),N(20); var : cnt(0),TL(0),hh(0),hi(0),ll(0),li(0); var : tl1(0),tl2(0),tl3(0),tl4(0); Array : ii[20](0); if bdate != bdate[1] Then { for cnt = 1 to 19 { ii[cnt] = ii[cnt-1][1]; } } ii[0] = index; TL_Delete(TL); TL_Delete(TL1); TL_Delete(TL2); TL_Delete(TL3); TL_Delete(TL4); if ii[X2] > 0 /* and abs(DayClose(X1)-DayClose(X2)) <= PriceScale*N*/ then { TL = TL_New(sdate[index-ii[x2]],stime[index-ii[x2]],DayClose(x1),sdate[index-ii[x1]],stime[index-ii[x1]],DayClose(x1)); hh = h[index-ii[x1]]; hi = 0; ll = l[index-ii[x1]]; li = 0; for cnt = index-II[x1] to index-ii[x2]-1 { If h[cnt] > hh Then { hh = h[cnt]; hi = cnt; } if l[cnt] < ll Then { ll = l[cnt]; li = cnt; } } TL1 = TL_New(sdate[index-ii[x2]],stime[index-ii[x2]],DayClose(x1),sdate[hi],stime[hi],hh); TL2 = TL_New(sdate[hi],stime[hi],hh,sdate[index-ii[x1]],stime[index-ii[x1]],DayClose(x1)); TL3 = TL_New(sdate[index-ii[x2]],stime[index-ii[x2]],DayClose(x1),sdate[li],stime[li],ll); TL4 = TL_New(sdate[li],stime[li],ll,sdate[index-ii[x1]],stime[index-ii[x1]],DayClose(x1)); } 즐거운 하루되세요 > yes 님이 쓴 글입니다. > 제목 : 부탁 드립니다. > 도움주심에 깊이 감사 드립니다. 다음 수식은 3일전 종가와 현재가를 비교하여 선을 긋고 있습니다. 이것을 10일전 종가(변수)와 3일전 종가(변수)를 비교하여 10일전에서 3일전 까지 TL,TL1,TL2,TL3,TL4선을 긋고 싶습니다. 미리 경배로 감사 드립니다. input : N(20); var : cnt(0),TL(0),hh(0),hi(0),ll(0),li(0); var : tl1(0),tl2(0),tl3(0),tl4(0); Array : DD[10](0),TT[10](0),ii[10](0); if bdate != bdate[1] Then { ii[0] = 0; for cnt = 1 to 9 { DD[cnt] = DD[cnt-1][1]; TT[cnt] = TT[cnt-1][1]; ii[cnt] = ii[cnt-1][1]; } } DD[0] = bdate; TT[0] = stime; ii[0] = ii[0]+1; TL_Delete(TL); TL_Delete(TL1); TL_Delete(TL2); TL_Delete(TL3); TL_Delete(TL4); if abs(C-DayClose(3)) <= PriceScale*N then { TL = TL_New(DD[3],TT[3],C,DD[0],TT[0],C); hh = h[0]; hi = 0; ll = l[0]; li = 0; for cnt = 0 to (ii[0]+ii[1]+ii[2]-1) { if h[cnt] > hh Then { hh = h[cnt]; hi = cnt; } if l[cnt] < ll Then { ll = l[cnt]; li = cnt; } } TL1 = TL_New(DD[3],TT[3],C,sdate[hi],stime[hi],hh); TL2 = TL_New(sdate[hi],stime[hi],hh,sdate,stime,c); TL3 = TL_New(DD[3],TT[3],C,sdate[li],stime[li],ll); TL4 = TL_New(sdate[li],stime[li],ll,sdate,stime,c); }