커뮤니티

오류메세지 수정 부탁드립니다.

프로필 이미지
매버릭
2017-03-11 08:13:10
168
글번호 107690
답변완료
수고 많으십니다. 아래 수식의 오류메세지 수정을 못하겠는데 부탁 좀 드리겠습니다. 감사합니다. //========================================== // Indicator Name : Min Change Rate ZigZag Wave // Version : 1.1 // Written by : yahoosir // Blog : http://yahoosir.blog.me //========================================== Input:Rate(5),ClsPxUseBit(0),waveLineSize(3),displPRC(1); Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),TL1(0),Text1(0),lastVertex(""),procBit(""); Array:PK[10,4](0),VL[10,4](0); // 1:Price,2:BarNumber,3:Date,4:Time //========================================== HH = IFF(ClsPxUseBit = 1,C,H); LL = IFF(ClsPxUseBit = 1,C,L); If CurrentBar = 1 Then Begin PK[1,1] = HH; PK[1,2] = 0; PK[1,3] = Date; PK[1,4] = Time; VL[1,1] = LL; VL[1,2] = 0; VL[1,3] = Date; VL[1,4] = Time; End; If CurrentBar > 0 Then Begin hiBar = hiBar + 1; loBar = loBar + 1; End; If HH[hiBar] < HH Then hiBar = 0; If LL[loBar] > LL Then loBar = 0; Condition1 = VL[1,1] * (1 + (Rate/100)) <= HH and hiBar = 0; Condition2 = PK[1,1] * (1 - (Rate/100)) >= LL and loBar = 0; procBit = ""; If Condition1 and Condition2 Then Begin If lastVertex = "Valley" Then Begin If PK[1,1] < HH and VL[1,1] > LL Then procBit = "Peak" Else If VL[1,1] > LL Then procBit = "Valley" Else procBit = "Peak"; End Else Begin If PK[1,1] < HH and VL[1,1] > LL Then procBit = "Valley" Else If PK[1,1] < HH Then procBit = "Peak" Else procBit = "Valley"; End; End Else If Condition1 Then procBit = "Peak" Else If Condition2 Then procBit = "Valley"; //========================================== If procBit = "Peak" Then Begin If lastVertex = "Valley" Then Begin For j = 10 DownTo 2 Begin For jj = 1 To 4 Begin PK[j,jj] = PK[j-1,jj]; End ; End; PK[1,1] = HH[hiBar]; PK[1,2] = BarNumber - hiBar; PK[1,3] = Date[hiBar]; PK[1,4] = Time[hiBar]; hiBar = -1; loBar = -1; TL1 = TL_New(VL[1,3],VL[1,4],VL[1,1],PK[1,3],PK[1,4],PK[1,1]); If displPRC = 1 Then Begin Text1 = Text_New(PK[1,3],PK[1,4],PK[1,1],NumToStr(PK[1,1],2)); Text_SetStyle(Text1, 2, 1); Text_SetColor(Text1,black); End ; TL_SetSize(TL1,waveLineSize); TL_SetColor(TL1,Red); End Else If PK[1,1] < HH[hiBar] Then Begin PK[1,1] = HH[hiBar]; PK[1,2] = BarNumber - hiBar; PK[1,3] = Date[hiBar]; PK[1,4] = Time[hiBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL1,PK[1,3],PK[1,4],PK[1,1]); If displPRC = 1 Then Begin Text_SetLocation(Text1,PK[1,3],PK[1,4],PK[1,1]); Text_SetString(Text1,NumToStr(PK[1,1],2)); End; End ; lastVertex = "Peak"; End ; //========================================== If procBit = "Valley" Then Begin If lastVertex = "Peak" then Begin For j = 10 DownTo 2 Begin For jj = 1 To 4 Begin VL[j,jj] = VL[j-1,jj]; End; End; VL[1,1] = LL[loBar]; VL[1,2] = BarNumber - loBar; VL[1,3] = Date[loBar]; VL[1,4] = Time[loBar]; hiBar = -1; loBar = -1; TL1 = TL_New(PK[1,3],PK[1,4],PK[1,1],VL[1,3],VL[1,4],VL[1,1]); If displPRC = 1 Then Begin Text1 = Text_New(VL[1,3],VL[1,4],VL[1,1],NumToStr(VL[1,1],2)); Text_SetStyle(Text1, 2, 0); Text_SetColor(Text1,black); End ; TL_SetSize(TL1,waveLineSize); TL_SetColor(TL1,Blue); End Else If VL[1,1] > LL[loBar] then Begin VL[1,1] = LL[loBar]; VL[1,2] = BarNumber - loBar; VL[1,3] = Date[loBar]; VL[1,4] = Time[loBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL1,VL[1,3],VL[1,4],VL[1,1]); If displPRC = 1 Then Begin Text_SetLocation(Text1,VL[1,3],VL[1,4],VL[1,1]); Text_SetString(Text1,NumToStr(VL[1,1],2)); End ; End ; lastVertex = "Valley"; End ;
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2017-03-13 15:22:54

안녕하세요 예스스탁입니다. //========================================== // Indicator Name : Min Change Rate ZigZag Wave // Version : 1.1 // Written by : yahoosir // Blog : http://yahoosir.blog.me //========================================== Input:Rate(5),ClsPxUseBit(0),waveLineSize(3),displPRC(1); Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),TL1(0),Text1(0),lastVertex(""),procBit(""); Array:PK[10,4](0),VL[10,4](0); // 1:Price,2:BarNumber,3:Date,4:Time //========================================== HH = IFF(ClsPxUseBit == 1,C,H); LL = IFF(ClsPxUseBit == 1,C,L); If CurrentBar == 1 Then Begin PK[1,1] = HH; PK[1,2] = 0; PK[1,3] = Date; PK[1,4] = Time; VL[1,1] = LL; VL[1,2] = 0; VL[1,3] = Date; VL[1,4] = Time; End; If CurrentBar > 0 Then Begin hiBar = hiBar + 1; loBar = loBar + 1; End; If HH[hiBar] < HH Then hiBar = 0; If LL[loBar] > LL Then loBar = 0; Condition1 = VL[1,1] * (1 + (Rate/100)) <= HH and hiBar == 0; Condition2 = PK[1,1] * (1 - (Rate/100)) >= LL and loBar == 0; procBit = ""; If Condition1 and Condition2 Then Begin If lastVertex == "Valley" Then Begin If PK[1,1] < HH and VL[1,1] > LL Then procBit = "Peak"; Else If VL[1,1] > LL Then procBit = "Valley" ; Else procBit = "Peak"; End Else Begin If PK[1,1] < HH and VL[1,1] > LL Then procBit = "Valley"; Else If PK[1,1] < HH Then procBit = "Peak"; Else procBit = "Valley"; End; End Else If Condition1 Then procBit = "Peak"; Else If Condition2 Then procBit = "Valley"; //========================================== If procBit == "Peak" Then Begin If lastVertex == "Valley" Then Begin For j = 10 DownTo 2 Begin For jj = 1 To 4 Begin PK[j,jj] = PK[j-1,jj]; End ; End; PK[1,1] = HH[hiBar]; PK[1,2] = index - hiBar; PK[1,3] = Date[hiBar]; PK[1,4] = Time[hiBar]; hiBar = -1; loBar = -1; TL1 = TL_New(VL[1,3],VL[1,4],VL[1,1],PK[1,3],PK[1,4],PK[1,1]); If displPRC == 1 Then Begin Text1 = Text_New(PK[1,3],PK[1,4],PK[1,1],NumToStr(PK[1,1],2)); Text_SetStyle(Text1, 2, 1); Text_SetColor(Text1,black); End ; TL_SetSize(TL1,waveLineSize); TL_SetColor(TL1,Red); End Else If PK[1,1] < HH[hiBar] Then Begin PK[1,1] = HH[hiBar]; PK[1,2] = index - hiBar; PK[1,3] = Date[hiBar]; PK[1,4] = Time[hiBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL1,PK[1,3],PK[1,4],PK[1,1]); If displPRC == 1 Then Begin Text_SetLocation(Text1,PK[1,3],PK[1,4],PK[1,1]); Text_SetString(Text1,NumToStr(PK[1,1],2)); End; End ; lastVertex = "Peak"; End ; //========================================== If procBit == "Valley" Then Begin If lastVertex == "Peak" then Begin For j = 10 DownTo 2 Begin For jj = 1 To 4 Begin VL[j,jj] = VL[j-1,jj]; End; End; VL[1,1] = LL[loBar]; VL[1,2] = index - loBar; VL[1,3] = Date[loBar]; VL[1,4] = Time[loBar]; hiBar = -1; loBar = -1; TL1 = TL_New(PK[1,3],PK[1,4],PK[1,1],VL[1,3],VL[1,4],VL[1,1]); If displPRC == 1 Then Begin Text1 = Text_New(VL[1,3],VL[1,4],VL[1,1],NumToStr(VL[1,1],2)); Text_SetStyle(Text1, 2, 0); Text_SetColor(Text1,black); End ; TL_SetSize(TL1,waveLineSize); TL_SetColor(TL1,Blue); End Else If VL[1,1] > LL[loBar] then Begin VL[1,1] = LL[loBar]; VL[1,2] = index - loBar; VL[1,3] = Date[loBar]; VL[1,4] = Time[loBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL1,VL[1,3],VL[1,4],VL[1,1]); If displPRC == 1 Then Begin Text_SetLocation(Text1,VL[1,3],VL[1,4],VL[1,1]); Text_SetString(Text1,NumToStr(VL[1,1],2)); End ; End ; lastVertex = "Valley"; End ; 즐거운 하루되세요 > 매버릭 님이 쓴 글입니다. > 제목 : 오류메세지 수정 부탁드립니다. > 수고 많으십니다. 아래 수식의 오류메세지 수정을 못하겠는데 부탁 좀 드리겠습니다. 감사합니다. //========================================== // Indicator Name : Min Change Rate ZigZag Wave // Version : 1.1 // Written by : yahoosir // Blog : http://yahoosir.blog.me //========================================== Input:Rate(5),ClsPxUseBit(0),waveLineSize(3),displPRC(1); Var:j(0),jj(0),HH(0),LL(0),hiBar(0),loBar(0),TL1(0),Text1(0),lastVertex(""),procBit(""); Array:PK[10,4](0),VL[10,4](0); // 1:Price,2:BarNumber,3:Date,4:Time //========================================== HH = IFF(ClsPxUseBit = 1,C,H); LL = IFF(ClsPxUseBit = 1,C,L); If CurrentBar = 1 Then Begin PK[1,1] = HH; PK[1,2] = 0; PK[1,3] = Date; PK[1,4] = Time; VL[1,1] = LL; VL[1,2] = 0; VL[1,3] = Date; VL[1,4] = Time; End; If CurrentBar > 0 Then Begin hiBar = hiBar + 1; loBar = loBar + 1; End; If HH[hiBar] < HH Then hiBar = 0; If LL[loBar] > LL Then loBar = 0; Condition1 = VL[1,1] * (1 + (Rate/100)) <= HH and hiBar = 0; Condition2 = PK[1,1] * (1 - (Rate/100)) >= LL and loBar = 0; procBit = ""; If Condition1 and Condition2 Then Begin If lastVertex = "Valley" Then Begin If PK[1,1] < HH and VL[1,1] > LL Then procBit = "Peak" Else If VL[1,1] > LL Then procBit = "Valley" Else procBit = "Peak"; End Else Begin If PK[1,1] < HH and VL[1,1] > LL Then procBit = "Valley" Else If PK[1,1] < HH Then procBit = "Peak" Else procBit = "Valley"; End; End Else If Condition1 Then procBit = "Peak" Else If Condition2 Then procBit = "Valley"; //========================================== If procBit = "Peak" Then Begin If lastVertex = "Valley" Then Begin For j = 10 DownTo 2 Begin For jj = 1 To 4 Begin PK[j,jj] = PK[j-1,jj]; End ; End; PK[1,1] = HH[hiBar]; PK[1,2] = BarNumber - hiBar; PK[1,3] = Date[hiBar]; PK[1,4] = Time[hiBar]; hiBar = -1; loBar = -1; TL1 = TL_New(VL[1,3],VL[1,4],VL[1,1],PK[1,3],PK[1,4],PK[1,1]); If displPRC = 1 Then Begin Text1 = Text_New(PK[1,3],PK[1,4],PK[1,1],NumToStr(PK[1,1],2)); Text_SetStyle(Text1, 2, 1); Text_SetColor(Text1,black); End ; TL_SetSize(TL1,waveLineSize); TL_SetColor(TL1,Red); End Else If PK[1,1] < HH[hiBar] Then Begin PK[1,1] = HH[hiBar]; PK[1,2] = BarNumber - hiBar; PK[1,3] = Date[hiBar]; PK[1,4] = Time[hiBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL1,PK[1,3],PK[1,4],PK[1,1]); If displPRC = 1 Then Begin Text_SetLocation(Text1,PK[1,3],PK[1,4],PK[1,1]); Text_SetString(Text1,NumToStr(PK[1,1],2)); End; End ; lastVertex = "Peak"; End ; //========================================== If procBit = "Valley" Then Begin If lastVertex = "Peak" then Begin For j = 10 DownTo 2 Begin For jj = 1 To 4 Begin VL[j,jj] = VL[j-1,jj]; End; End; VL[1,1] = LL[loBar]; VL[1,2] = BarNumber - loBar; VL[1,3] = Date[loBar]; VL[1,4] = Time[loBar]; hiBar = -1; loBar = -1; TL1 = TL_New(PK[1,3],PK[1,4],PK[1,1],VL[1,3],VL[1,4],VL[1,1]); If displPRC = 1 Then Begin Text1 = Text_New(VL[1,3],VL[1,4],VL[1,1],NumToStr(VL[1,1],2)); Text_SetStyle(Text1, 2, 0); Text_SetColor(Text1,black); End ; TL_SetSize(TL1,waveLineSize); TL_SetColor(TL1,Blue); End Else If VL[1,1] > LL[loBar] then Begin VL[1,1] = LL[loBar]; VL[1,2] = BarNumber - loBar; VL[1,3] = Date[loBar]; VL[1,4] = Time[loBar]; hiBar = -1; loBar = -1; TL_SetEnd(TL1,VL[1,3],VL[1,4],VL[1,1]); If displPRC = 1 Then Begin Text_SetLocation(Text1,VL[1,3],VL[1,4],VL[1,1]); Text_SetString(Text1,NumToStr(VL[1,1],2)); End ; End ; lastVertex = "Valley"; End ;