커뮤니티

부탁드립니다

프로필 이미지
파생돌이
2018-03-02 13:05:50
145
글번호 117095
답변완료
수고하십니다 56849번 재질문입니다 *하락시일때 전일봉에 표시부탁드립니다
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-03-02 14:44:23

안녕하세요 예스스탁입니다. 수정한 식입니다. Input:length(6); Var:j(0),lastHiVal(0),lastLoVal(0),sBar(0),eBar(0),TL1(0),Text1(0),처리구분(""); var : TL2(0),TL3(0),TL4(0),TL5(0),T(0),B(0),S(0),cnt(0),TL6(0),TL7(0),TL8(0),TL9(0); var : day1(0),time1(0),close1(0),TL99(0); Array:고점[10,2](0),저점[10,2](0); //가격,위치 처리구분 = ""; If Highest(H,length) == H and lastHiVal <> H and Lowest(L,length) == L and lastLoVal <> L Then { If 저점[1,1] > L Then 처리구분 = "저점처리"; If 고점[1,1] < H Then 처리구분 = "고점처리"; } Else If Highest(H,length) == H and lastHiVal <> H Then 처리구분 = "고점처리"; Else If Lowest(L,length) == L and lastLoVal <> L Then 처리구분 = "저점처리"; If 처리구분 == "고점처리" Then { T = 1; lastHiVal = H; If 고점[1,2] < 저점[1,2] Then { For j = 10 DownTo 2 { 고점[j,1] = 고점[j-1,1]; 고점[j,2] = 고점[j-1,2]; } } If 고점[1,2] < 저점[1,2] or 고점[1,1] < H Then { 고점[1,1] = H; 고점[1,2] = Index; sBar = Index - 저점[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } TL1 = TL_New(sDate[sBar],sTime[sBar],저점[1,1],sDate[eBar],sTime[eBar],고점[1,1]); #Text1 = Text_New(sDate[eBar],sTime[eBar],고점[1,1], #NumToStr(고점[1,1],2)); #Text_SetStyle(Text1, 2, 1); } } If 처리구분 == "저점처리" Then { T = -1; lastLoVal = L; If 저점[1,2] < 고점[1,2] then { For j = 10 DownTo 2 { 저점[j,1] = 저점[j-1,1]; 저점[j,2] = 저점[j-1,2]; } } If 저점[1,2] < 고점[1,2] or 저점[1,1] > L then { 저점[1,1] = L; 저점[1,2] = Index; sBar = Index - 고점[1,2]; eBar = 0; If TL_GetBeginDate(TL1) == sDate[sBar] and TL_GetBeginTime(TL1) == sTime[sBar] Then { TL_Delete(TL1); Text_Delete(Text1); } TL1 = TL_New(sDate[sBar],sTime[sBar],고점[1,1], sDate[eBar],sTime[eBar],저점[1,1]); #Text1 = Text_New(sDate[eBar],sTime[eBar],저점[1,1], # NumToStr(저점[1,1],2)); #Text_SetStyle(Text1, 2, 0); } } TL_SetSize(TL1,3); TL_SetColor(TL1,CYAN); if T == -1 and T[1] != -1 Then{ TL2 = TL_New(sdate[index-고점[2,2]],stime[index-고점[2,2]],고점[2,1], sdate[index-고점[1,2]],stime[index-고점[1,2]],고점[2,1]); TL_SetSize(TL2,3); TL_SetColor(TL2,BLACK); TL_Delete(TL3); TL3 = TL_New(sdate[index-고점[1,2]],stime[index-고점[1,2]],고점[1,1],sdate,stime,고점[1,1]); TL_SetExtRight(TL3,true); TL_SetSize(TL3,3); TL_SetColor(TL3,BLACK); B = 0; for cnt = index-고점[1,2]+1 to index-고점[2,2] { if B == 0 and C[cnt] > O[cnt] Then { B = 1; S = cnt; if H[cnt] >= 고점[1,1] Then B = 2; } } MessageLog("%.f %.f",B,S); TL_Delete(TL6); TL_Delete(TL7); TL_Delete(TL8); TL_Delete(TL9); if B >= 1 Then{ TL8 = TL_New(sdate[S],stime[S],C[S],Sdate,stime,C[S]); TL_SetExtRight(TL8,true); TL_SetColor(TL8,BLUE); } if B == 2 Then{ TL9 = TL_New(sdate[S],stime[S],H[S],Sdate,stime,H[S]); TL_SetExtRight(TL9,true); TL_SetColor(TL9,BLUE); } } if T == 1 and T[1] != 1 Then{ TL_Delete(TL99); TL4 = TL_New(sdate[index-저점[2,2]],STime[index-저점[2,2]],저점[2,1], sdate[index-저점[1,2]],stime[index-저점[1,2]],저점[2,1]); TL_SetSize(TL4,3); TL_SetColor(TL4,BLACK); TL_Delete(TL5); TL5= TL_New(sdate[index-저점[1,2]],sTime[index-저점[1,2]],저점[1,1],sdate,stime,저점[1,1]); TL_SetExtRight(TL5,true); TL_SetSize(TL5,3); TL_SetColor(TL5,BLACK); TL_Delete(TL6); TL_Delete(TL7); TL_Delete(TL8); TL_Delete(TL9); B = 0; for cnt = index-저점[1,2] downto 0 { if B == 0 and C[cnt] > O[cnt] Then { B = 1; S = cnt; if L[cnt] <= 저점[1,1] Then B = 2; } } if B >= 1 Then{ TL6 = TL_New(sdate[S+1],stime[S+1],O[S],Sdate,stime,O[S]); TL_SetExtRight(TL6,true); TL_SetColor(TL6,RED); } if B == 2 Then{ TL7 = TL_New(sdate[S+1],stime[S+1],L[S],Sdate,stime,L[S]); TL_SetExtRight(TL7,true); TL_SetColor(TL7,RED); } } if T == 1 and B == 0 and C > O Then { B = 1; TL6 = TL_New(sdate[1],stime[1],O,Sdate,stime,O); TL_SetExtRight(TL6,true); TL_SetColor(TL6,RED); if L <= 저점[1,1] Then { TL7 = TL_New(sdate[S+1],stime[S+1],L[S],Sdate,stime,L[S]); TL_SetExtRight(TL7,true); TL_SetColor(TL7,RED); } } 즐거운 하루되세요