커뮤니티

문의드립니다

프로필 이미지
새벽에
2023-02-01 06:35:10
968
글번호 165900
답변완료
안녕하세요? 아래수식을 data2 불러오지않코 단독으로 사용할수있도록 부탁드립니다 감사합니다 input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,data2(C),data2(H)); LL = IFF(0==1,data2(C),data2(L)); If data2(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = data2(Highest(HH,length)) == HH and 최종고가 <> HH; Condition2 = data2(Lowest (LL,length)) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],data2(sdate),data2(stime),고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],data2(Sdate),data2(Stime),고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],data2(sdate),data2(stime),저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],data2(sdate),data2(stime),저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); }
지표
답변 6
프로필 이미지

예스스탁 예스스탁 답변

2023-02-01 08:55:31

안녕하세요. 예스스탁 입니다. 기본종목(Data1)의 가격을 기준으로 사용하실 수 있도록 지표식을 수정드립니다. 즐거운 하루 보내세요. input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,data2(C),data2(H)); LL = IFF(0==1,data2(C),data2(L)); If data2(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = data2(Highest(HH,length)) == HH and 최종고가 <> HH; Condition2 = data2(Lowest (LL,length)) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],data2(sdate),data2(stime),고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],data2(Sdate),data2(Stime),고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],data2(sdate),data2(stime),저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],data2(sdate),data2(stime),저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); } > 새벽에 님이 쓴 글입니다. > 제목 : 문의드립니다 > 안녕하세요? 아래수식을 data2 불러오지않코 단독으로 사용할수있도록 부탁드립니다 감사합니다 input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,data2(C),data2(H)); LL = IFF(0==1,data2(C),data2(L)); If data2(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = data2(Highest(HH,length)) == HH and 최종고가 <> HH; Condition2 = data2(Lowest (LL,length)) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],data2(sdate),data2(stime),고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],data2(Sdate),data2(Stime),고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],data2(sdate),data2(stime),저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],data2(sdate),data2(stime),저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); }
프로필 이미지

새벽에

2023-02-01 10:03:24

새로주신 수식을 적용하여보았으나 ? 첨부사진처럼 data2를 요구하고 있습니다 data2 불러와 적용 없이 그냥 챠트에적용하면 되기를 원했는데 제의도가 잘못전달된것 같습니다 죄송합니다 부탁드립니다 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의드립니다 > 안녕하세요. 예스스탁 입니다. 기본종목(Data1)의 가격을 기준으로 사용하실 수 있도록 지표식을 수정드립니다. 즐거운 하루 보내세요. input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,data2(C),data2(H)); LL = IFF(0==1,data2(C),data2(L)); If data2(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = data2(Highest(HH,length)) == HH and 최종고가 <> HH; Condition2 = data2(Lowest (LL,length)) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],data2(sdate),data2(stime),고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],data2(Sdate),data2(Stime),고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],data2(sdate),data2(stime),저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],data2(sdate),data2(stime),저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); } > 새벽에 님이 쓴 글입니다. > 제목 : 문의드립니다 > 안녕하세요? 아래수식을 data2 불러오지않코 단독으로 사용할수있도록 부탁드립니다 감사합니다 input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,data2(C),data2(H)); LL = IFF(0==1,data2(C),data2(L)); If data2(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = data2(Highest(HH,length)) == HH and 최종고가 <> HH; Condition2 = data2(Lowest (LL,length)) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],data2(sdate),data2(stime),고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],data2(Sdate),data2(Stime),고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],data2(sdate),data2(stime),저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],data2(sdate),data2(stime),저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); }
프로필 이미지

예스스탁

2023-02-01 10:24:27

예스스탁 님에 의해 삭제된 답변입니다.
프로필 이미지

예스스탁 예스스탁 답변

2023-02-01 10:24:28

안녕하세요. 예스스탁 입니다. 수식 복사/붙여넣기 과정에 실수가 있었던 것 같습니다. 다시 수식을 공유드립니다. input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,C,H); LL = IFF(0==1,C,L); If data1(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = Highest(HH,length) == HH and 최종고가 <> HH; Condition2 = Lowest (LL,length) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = Index; 고[1,3] = sDate; 고[1,4] = sTime; TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = Index; 고[1,3] = sDate; 고[1,4] = sTime; TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = Index; 저[1,3] = sDate; 저[1,4] = sTime; TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = Index; 저[1,3] = sDate; 저[1,4] = sTime; TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],sdate,stime,고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],Sdate,Stime,고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],sdate,stime,저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],sdate,stime,저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); } 즐거운 하루 보내세요. > 새벽에 님이 쓴 글입니다. > 제목 : Re : Re : 문의드립니다 > 새로주신 수식을 적용하여보았으나 ? 첨부사진처럼 data2를 요구하고 있습니다 data2 불러와 적용 없이 그냥 챠트에적용하면 되기를 원했는데 제의도가 잘못전달된것 같습니다 죄송합니다 부탁드립니다 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의드립니다 > 안녕하세요. 예스스탁 입니다. 기본종목(Data1)의 가격을 기준으로 사용하실 수 있도록 지표식을 수정드립니다. 즐거운 하루 보내세요. input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,data2(C),data2(H)); LL = IFF(0==1,data2(C),data2(L)); If data2(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = data2(Highest(HH,length)) == HH and 최종고가 <> HH; Condition2 = data2(Lowest (LL,length)) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],data2(sdate),data2(stime),고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],data2(Sdate),data2(Stime),고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],data2(sdate),data2(stime),저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],data2(sdate),data2(stime),저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); } > 새벽에 님이 쓴 글입니다. > 제목 : 문의드립니다 > 안녕하세요? 아래수식을 data2 불러오지않코 단독으로 사용할수있도록 부탁드립니다 감사합니다 input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,data2(C),data2(H)); LL = IFF(0==1,data2(C),data2(L)); If data2(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = data2(Highest(HH,length)) == HH and 최종고가 <> HH; Condition2 = data2(Lowest (LL,length)) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],data2(sdate),data2(stime),고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],data2(Sdate),data2(Stime),고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],data2(sdate),data2(stime),저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],data2(sdate),data2(stime),저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); }
프로필 이미지

새벽에

2023-02-01 11:00:46

수식감사드립니다 수식적용시 챠트에 적용하면 첨부사진1처럼 잘표현이됩니다 그런데 챠트의공간을 확보하기위해 첨부사진1의 화살표를 누르면 첨부사진2처럼 magenta 컬러의 박스만 사라집니다. 번거롭게 하여 죄송합니다 검토부탁드립니다 감사합니다 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : Re : Re : 문의드립니다 > 안녕하세요. 예스스탁 입니다. 수식 복사/붙여넣기 과정에 실수가 있었던 것 같습니다. 다시 수식을 공유드립니다. input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,C,H); LL = IFF(0==1,C,L); If data1(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = Highest(HH,length) == HH and 최종고가 <> HH; Condition2 = Lowest (LL,length) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = Index; 고[1,3] = sDate; 고[1,4] = sTime; TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = Index; 고[1,3] = sDate; 고[1,4] = sTime; TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = Index; 저[1,3] = sDate; 저[1,4] = sTime; TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = Index; 저[1,3] = sDate; 저[1,4] = sTime; TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],sdate,stime,고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],Sdate,Stime,고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],sdate,stime,저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],sdate,stime,저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); } 즐거운 하루 보내세요. > 새벽에 님이 쓴 글입니다. > 제목 : Re : Re : 문의드립니다 > 새로주신 수식을 적용하여보았으나 ? 첨부사진처럼 data2를 요구하고 있습니다 data2 불러와 적용 없이 그냥 챠트에적용하면 되기를 원했는데 제의도가 잘못전달된것 같습니다 죄송합니다 부탁드립니다 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의드립니다 > 안녕하세요. 예스스탁 입니다. 기본종목(Data1)의 가격을 기준으로 사용하실 수 있도록 지표식을 수정드립니다. 즐거운 하루 보내세요. input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,data2(C),data2(H)); LL = IFF(0==1,data2(C),data2(L)); If data2(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = data2(Highest(HH,length)) == HH and 최종고가 <> HH; Condition2 = data2(Lowest (LL,length)) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],data2(sdate),data2(stime),고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],data2(Sdate),data2(Stime),고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],data2(sdate),data2(stime),저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],data2(sdate),data2(stime),저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); } > 새벽에 님이 쓴 글입니다. > 제목 : 문의드립니다 > 안녕하세요? 아래수식을 data2 불러오지않코 단독으로 사용할수있도록 부탁드립니다 감사합니다 input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,data2(C),data2(H)); LL = IFF(0==1,data2(C),data2(L)); If data2(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = data2(Highest(HH,length)) == HH and 최종고가 <> HH; Condition2 = data2(Lowest (LL,length)) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],data2(sdate),data2(stime),고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],data2(Sdate),data2(Stime),고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],data2(sdate),data2(stime),저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],data2(sdate),data2(stime),저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); }
프로필 이미지

예스스탁 예스스탁 답변

2023-02-01 11:45:56

안녕하세요. 지표 속성창 [Y축 표시]의 최대/최소 설정값을 [가격]으로 변경하시면, 숨김 처리 후에도 Box 함수가 정상 작동합니다. 화면으로 선택한 경우에도 숨김 후 사용하실 수 있도록 개발중에 있습니다. 즐거운 하루 보내세요. > 새벽에 님이 쓴 글입니다. > 제목 : Re : Re : Re : Re : 문의드립니다 > 수식감사드립니다 수식적용시 챠트에 적용하면 첨부사진1처럼 잘표현이됩니다 그런데 챠트의공간을 확보하기위해 첨부사진1의 화살표를 누르면 첨부사진2처럼 magenta 컬러의 박스만 사라집니다. 번거롭게 하여 죄송합니다 검토부탁드립니다 감사합니다 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : Re : Re : 문의드립니다 > 안녕하세요. 예스스탁 입니다. 수식 복사/붙여넣기 과정에 실수가 있었던 것 같습니다. 다시 수식을 공유드립니다. input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,C,H); LL = IFF(0==1,C,L); If data1(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = Highest(HH,length) == HH and 최종고가 <> HH; Condition2 = Lowest (LL,length) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = Index; 고[1,3] = sDate; 고[1,4] = sTime; TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = Index; 고[1,3] = sDate; 고[1,4] = sTime; TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = Index; 저[1,3] = sDate; 저[1,4] = sTime; TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = Index; 저[1,3] = sDate; 저[1,4] = sTime; TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],sdate,stime,고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],Sdate,Stime,고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],sdate,stime,저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],sdate,stime,저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); } 즐거운 하루 보내세요. > 새벽에 님이 쓴 글입니다. > 제목 : Re : Re : 문의드립니다 > 새로주신 수식을 적용하여보았으나 ? 첨부사진처럼 data2를 요구하고 있습니다 data2 불러와 적용 없이 그냥 챠트에적용하면 되기를 원했는데 제의도가 잘못전달된것 같습니다 죄송합니다 부탁드립니다 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 문의드립니다 > 안녕하세요. 예스스탁 입니다. 기본종목(Data1)의 가격을 기준으로 사용하실 수 있도록 지표식을 수정드립니다. 즐거운 하루 보내세요. input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,data2(C),data2(H)); LL = IFF(0==1,data2(C),data2(L)); If data2(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = data2(Highest(HH,length)) == HH and 최종고가 <> HH; Condition2 = data2(Lowest (LL,length)) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],data2(sdate),data2(stime),고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],data2(Sdate),data2(Stime),고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],data2(sdate),data2(stime),저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],data2(sdate),data2(stime),저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); } > 새벽에 님이 쓴 글입니다. > 제목 : 문의드립니다 > 안녕하세요? 아래수식을 data2 불러오지않코 단독으로 사용할수있도록 부탁드립니다 감사합니다 input:length(6); Var:j(0),jj(0),HH(0),LL(0),최종고가(0),최종저가(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0),TL2(0),TL3(0),TL4(0),TL5(0),TL12(0),TL13(0),TL14(0),TL15(0),T(0),고점변곡(""),저점변곡(""); var : clr1(0),clr2(0),BE(0),SE(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(0==1,data2(C),data2(H)); LL = IFF(0==1,data2(C),data2(L)); If data2(Index) == 0 Then { 고[1,1] = HH; 저[1,1] = LL; } Condition1 = data2(Highest(HH,length)) == HH and 최종고가 <> HH; Condition2 = data2(Lowest (LL,length)) == LL and 최종저가 <> LL; 처리구분 = ""; If Condition1 and Condition2 Then // 기간고점과 기간저점 동시 발생 { If 최종꼭지점 == "저점" Then { If 저[1,1] > LL Then 처리구분 = "저점처리"; Else 처리구분 = "고점처리"; } Else If 최종꼭지점 == "고점" Then { If 고[1,1] < HH Then 처리구분 = "고점처리"; Else 처리구분 = "저점처리"; } } Else If Condition1 Then 처리구분 = "고점처리"; Else If Condition2 Then 처리구분 = "저점처리"; #==========================================# If 처리구분 == "고점처리" Then { T = 1; 최종고가 = HH; // 신규고점을 체크하기 위해 저장 If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 1 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],2)); Text_SetStyle(Text1, 0, 1); Text_SetColor(Text1,Red); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 고[1,1] < HH Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH; 고[1,2] = data2(Index); 고[1,3] = data2(sDate); 고[1,4] = data2(sTime); TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); // 시작점은 변동없고 끝점의 위치가 현재 봉으로 연장된 것임 If 1 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],2)); } } 최종꼭지점 = "고점"; } #==========================================# If 처리구분 == "저점처리" Then { T = -1; 최종저가 = LL; If 최종꼭지점 == "고점" then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],2)); Text_SetStyle(Text1, 0, -1); Text_SetColor(Text1,Blue); } TL_SetSize(TL1,1); TL_SetColor(TL1,Gray); } Else If 저[1,1] > LL then { 저[1,1] = LL; 저[1,2] = data2(Index); 저[1,3] = data2(sDate); 저[1,4] = data2(sTime); TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 1 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],2)); } } 최종꼭지점 = "저점"; } if T == -1 and T[1] != -1 Then { TL12 = TL_New(고[2,3],고[2,4],고[2,1],data2(sdate),data2(stime),고[2,1]); TL_Delete(TL13); TL13 = TL_New(고[1,3],고[1,4],고[1,1],data2(Sdate),data2(Stime),고[1,1]); TL_SetExtRight(TL13,true); TL_SetSize(TL13,2); TL_SetColor(TL12,clr1); TL_SetSize(TL12,2); clr1 = Pink; TL_SetColor(TL13,Pink); } if T == 1 and T[1] != 1 Then { TL14= TL_New(저[2,3],저[2,4],저[2,1],data2(sdate),data2(stime),저[2,1]); TL_Delete(TL15); TL15= TL_New(저[1,3],저[1,4],저[1,1],data2(sdate),data2(stime),저[1,1]); TL_SetExtRight(TL15,true); TL_SetColor(TL14,clr2); TL_SetSize(TL14,2); clr2 = LightBlue; TL_SetColor(TL15,clr2); TL_SetSize(TL15,2); } #================================================================# VAR:mav5(0),mav10(0),mav20(0),mav40(0),mav60(0),mav120(0),aa(0); mav5=ma(c,5); mav10=ma(c,10); mav20=ma(c,20); mav40=ma(c,40); mav60=ma(c,60); mav120=ma(c,120); condition11=CountIf(mav10<mav20,20) >= 10 and t==1 and 저[1,1] <mav20[Index-저[1,2]] and 고[1,1]>mav20[Index-고[1,2]]; var:box1(0); if t == 1 Then { if t != t[1] Then Condition12 = false; if condition11 == true and Condition12 == False Then { Condition12 = true; Box1 = Box_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); Box_Setcolor(box1,MAGENTA); Box_Setfill(box1,true,100,true); } if Condition12 == true Then Box_SetEnd(box1,고[1,3],고[1,4],고[1,1]); }