커뮤니티

지표 출력보완 요청드립니다.

프로필 이미지
당일선물
2019-04-19 06:44:37
231
글번호 127960
답변완료
아래의 수식에서 파동선의 꼭지점에 표시되는 가격에 1.가격 2.전환대비가(직전꼭지점에서 최종꼭지점 까지의 틱수 3.상승파동 일 때 직전 고점돌파시 직전 고점대비 틱수/하락파동일때 직전 저점붕괴 시 저점대비 틱수 4.직전파동대비 % 예] 30000(100,55, 128.00%) 29900(-100, 105, 61.00%) 이렇게 문자가 출력되도록 부탁드립니다 Input:전환가격(50),종가사용여부(1),파동선두께(2),수치표시(1),소수(0); Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(종가사용여부 == 1,C,H); LL = IFF(종가사용여부 == 1,C,L); If Index == 0 Then { 고[1,1] = HH; 고[1,2] = 0; 고[1,3] = sDate; 고[1,4] = sTime; 저[1,1] = LL; 저[1,2] = 0; 저[1,3] = sDate; 저[1,4] = sTime; } If Index > 0 Then { hiBar = hiBar + 1; loBar = loBar + 1; } If HH[hiBar] < HH Then hiBar = 0; If LL[loBar] > LL Then loBar = 0; Condition1 = 저[1,1] + 전환가격 < HH and hiBar == 0; Condition2 = 고[1,1] - 전환가격 > LL and loBar == 0; 처리구분 = ""; 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 { If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH[hiBar]; 고[1,2] = Index - hiBar; 고[1,3] = sDate[hiBar]; 고[1,4] = sTime[hiBar]; hiBar = -1; loBar = -1; TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 수치표시 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],소수)); Text_SetStyle(Text1, 2, 1); } TL_SetSize(TL1,파동선두께); TL_SetColor(TL1,Red); } Else If 고[1,1] < HH[hiBar] Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH[hiBar]; 고[1,2] = Index - hiBar; 고[1,3] = sDate[hiBar]; 고[1,4] = sTime[hiBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); If 수치표시 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],소수)); } } 최종꼭지점 = "고점"; } If 처리구분 == "저점처리" Then { If 최종꼭지점 == "고점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL[loBar]; 저[1,2] = Index - loBar; 저[1,3] = sDate[loBar]; 저[1,4] = sTime[loBar]; hiBar = -1; loBar = -1; TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 수치표시 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],소수)); Text_SetStyle(Text1, 2, 0); } TL_SetSize(TL1,파동선두께); TL_SetColor(TL1,Blue); } Else If 저[1,1] > LL[loBar] Then { 저[1,1] = LL[loBar]; 저[1,2] = Index - loBar; 저[1,3] = sDate[loBar]; 저[1,4] = sTime[loBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 수치표시 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],소수)); } } 최종꼭지점 = "저점"; }
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-04-19 14:13:40

안녕하세요 예스스탁입니다. Input:전환가격(50),종가사용여부(1),파동선두께(2),수치표시(1),소수(0); Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(종가사용여부 == 1,C,H); LL = IFF(종가사용여부 == 1,C,L); If Index == 0 Then { 고[1,1] = HH; 고[1,2] = 0; 고[1,3] = sDate; 고[1,4] = sTime; 저[1,1] = LL; 저[1,2] = 0; 저[1,3] = sDate; 저[1,4] = sTime; } If Index > 0 Then { hiBar = hiBar + 1; loBar = loBar + 1; } If HH[hiBar] < HH Then hiBar = 0; If LL[loBar] > LL Then loBar = 0; Condition1 = 저[1,1] + 전환가격 < HH and hiBar == 0; Condition2 = 고[1,1] - 전환가격 > LL and loBar == 0; 처리구분 = ""; 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 { If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH[hiBar]; 고[1,2] = Index - hiBar; 고[1,3] = sDate[hiBar]; 고[1,4] = sTime[hiBar]; hiBar = -1; loBar = -1; TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 수치표시 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1], NumToStr(고[1,1],소수)+"("+NumToStr((고[1,1]-저[1,1])/PriceScale,0)+","+ NumToStr((고[1,1]-고[2,1])/PriceScale,0)+","+ NumToStr((고[1,1]-저[1,1])/abs(고[2,1]-저[1,1])*100,2)+"%)"); Text_SetStyle(Text1, 2, 1); } TL_SetSize(TL1,파동선두께); TL_SetColor(TL1,Red); } Else If 고[1,1] < HH[hiBar] Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH[hiBar]; 고[1,2] = Index - hiBar; 고[1,3] = sDate[hiBar]; 고[1,4] = sTime[hiBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); If 수치표시 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1, NumToStr(고[1,1],소수)+"("+NumToStr((고[1,1]-저[1,1])/PriceScale,0)+","+ NumToStr((고[1,1]-고[2,1])/PriceScale,0)+","+ NumToStr((고[1,1]-저[1,1])/abs(고[2,1]-저[1,1])*100,2)+"%)"); } } 최종꼭지점 = "고점"; } If 처리구분 == "저점처리" Then { If 최종꼭지점 == "고점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL[loBar]; 저[1,2] = Index - loBar; 저[1,3] = sDate[loBar]; 저[1,4] = sTime[loBar]; hiBar = -1; loBar = -1; TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 수치표시 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1], NumToStr(저[1,1],소수)+"("+NumToStr((저[1,1]-고[1,1])/PriceScale,0)+","+ NumToStr((저[1,1]-저[2,1])/PriceScale,0)+","+ NumToStr((저[1,1]-고[1,1])/abs(고[1,1]-저[2,1])*100,2)+"%)"); Text_SetStyle(Text1, 2, 0); } TL_SetSize(TL1,파동선두께); TL_SetColor(TL1,Blue); } Else If 저[1,1] > LL[loBar] Then { 저[1,1] = LL[loBar]; 저[1,2] = Index - loBar; 저[1,3] = sDate[loBar]; 저[1,4] = sTime[loBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 수치표시 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1, NumToStr(저[1,1],소수)+"("+NumToStr(abs(저[1,1]-고[1,1])/PriceScale,0)+","+ NumToStr((고[1,1]-고[2,1])/PriceScale,0)+","+ NumToStr((저[1,1]-고[1,1])/abs(고[1,1]-저[2,1])*100,2)+"%)"); } } 최종꼭지점 = "저점"; } 즐거운 하루되세요 > 당일선물 님이 쓴 글입니다. > 제목 : 지표 출력보완 요청드립니다. > 아래의 수식에서 파동선의 꼭지점에 표시되는 가격에 1.가격 2.전환대비가(직전꼭지점에서 최종꼭지점 까지의 틱수 3.상승파동 일 때 직전 고점돌파시 직전 고점대비 틱수/하락파동일때 직전 저점붕괴 시 저점대비 틱수 4.직전파동대비 % 예] 30000(100,55, 128.00%) 29900(-100, 105, 61.00%) 이렇게 문자가 출력되도록 부탁드립니다 Input:전환가격(50),종가사용여부(1),파동선두께(2),수치표시(1),소수(0); Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),최종꼭지점(""),처리구분(""), TL1(0),Text1(0); Array:고[10,4](0),저[10,4](0); // 1:가격,2:Index,3:sDate,4:sTime #==========================================# HH = IFF(종가사용여부 == 1,C,H); LL = IFF(종가사용여부 == 1,C,L); If Index == 0 Then { 고[1,1] = HH; 고[1,2] = 0; 고[1,3] = sDate; 고[1,4] = sTime; 저[1,1] = LL; 저[1,2] = 0; 저[1,3] = sDate; 저[1,4] = sTime; } If Index > 0 Then { hiBar = hiBar + 1; loBar = loBar + 1; } If HH[hiBar] < HH Then hiBar = 0; If LL[loBar] > LL Then loBar = 0; Condition1 = 저[1,1] + 전환가격 < HH and hiBar == 0; Condition2 = 고[1,1] - 전환가격 > LL and loBar == 0; 처리구분 = ""; 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 { If 최종꼭지점 == "저점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 고[j,jj] = 고[j-1,jj]; } } 고[1,1] = HH[hiBar]; 고[1,2] = Index - hiBar; 고[1,3] = sDate[hiBar]; 고[1,4] = sTime[hiBar]; hiBar = -1; loBar = -1; TL1 = TL_New(저[1,3],저[1,4],저[1,1],고[1,3],고[1,4],고[1,1]); If 수치표시 == 1 Then { Text1 = Text_New(고[1,3],고[1,4],고[1,1],NumToStr(고[1,1],소수)); Text_SetStyle(Text1, 2, 1); } TL_SetSize(TL1,파동선두께); TL_SetColor(TL1,Red); } Else If 고[1,1] < HH[hiBar] Then // 1번 고점보다 높은 고가 출현 { 고[1,1] = HH[hiBar]; 고[1,2] = Index - hiBar; 고[1,3] = sDate[hiBar]; 고[1,4] = sTime[hiBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL1,고[1,3],고[1,4],고[1,1]); If 수치표시 == 1 Then { Text_SetLocation(Text1,고[1,3],고[1,4],고[1,1]); Text_SetString(Text1,NumToStr(고[1,1],소수)); } } 최종꼭지점 = "고점"; } If 처리구분 == "저점처리" Then { If 최종꼭지점 == "고점" Then { For j = 10 DownTo 2 { For jj = 1 To 4 { 저[j,jj] = 저[j-1,jj]; } } 저[1,1] = LL[loBar]; 저[1,2] = Index - loBar; 저[1,3] = sDate[loBar]; 저[1,4] = sTime[loBar]; hiBar = -1; loBar = -1; TL1 = TL_New(고[1,3],고[1,4],고[1,1],저[1,3],저[1,4],저[1,1]); If 수치표시 == 1 Then { Text1 = Text_New(저[1,3],저[1,4],저[1,1],NumToStr(저[1,1],소수)); Text_SetStyle(Text1, 2, 0); } TL_SetSize(TL1,파동선두께); TL_SetColor(TL1,Blue); } Else If 저[1,1] > LL[loBar] Then { 저[1,1] = LL[loBar]; 저[1,2] = Index - loBar; 저[1,3] = sDate[loBar]; 저[1,4] = sTime[loBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL1,저[1,3],저[1,4],저[1,1]); If 수치표시 == 1 Then { Text_SetLocation(Text1,저[1,3],저[1,4],저[1,1]); Text_SetString(Text1,NumToStr(저[1,1],소수)); } } 최종꼭지점 = "저점"; }