커뮤니티

지표문의 드립니다.

프로필 이미지
blueo
2020-08-18 23:39:25
775
글번호 141572
답변완료
안녕하세요 지그재그 지표를 찾던 중 수식지왕님의 지그재그 지표를 봤으며 아래와 같은 문의를 드립니다. 1. 똑같은 지그재그 선을 하나더 왼쪽이나 오른쪽으로 옮겨서 표시를 하고 싶습니다. 아래 수식 지왕님의 수식 중에 어떻게 해야 그렇게 표시되는지 부탁 드립니다. 감사 합니다. Input:chngRate(0.1); Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0); Array:valArr[10](0),barArr[10](0),turnPntArr[10](""); For j = 0 To 9 { barArr[j] = barArr[j] + 1; } Condition1 = Min(valArr[1],valArr[2]) * (1 + (chngRate/100)) < H and lastHiVal < H; Condition2 = Max(valArr[1],valArr[2]) * (1 - (chngRate/100)) > L and (lastLoVal > L || lastLoVal == 0); If Condition1 Then { lastHiVal = H; lastLoVal = 0; } If Condition2 Then { lastLoVal = L; lastHiVal = 0; } turnPntBit = ""; If Condition1 and Condition2 Then { If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then turnPntBit = "HiLo"; Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi"; Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo"; } Else If Condition1 Then turnPntBit = "Hi"; Else If Condition2 Then turnPntBit = "Lo"; If turnPntBit <> "" Then { If turnPntBit == "HiLo" Then { valArr[1] = IFF(turnPntArr[1] == "Hi",H,L); barArr[1] = 0; TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); If turnPntArr[1] == "Hi" Then turnPntBit = "Lo"; Else turnPntBit = "Hi"; } If turnPntBit <> turnPntArr[1] Then { for j = 8 downto 1 { valArr[j+1] = valArr[j]; barArr[j+1] = barArr[j]; turnPntArr[j+1] = turnPntArr[j]; } } If turnPntBit <> turnPntArr[1] or (turnPntBit == turnPntArr[1] and ((turnPntBit == "Hi" and valArr[1] < H) or (turnPntBit == "Lo" and valArr[1] > L))) Then { valArr[1] = IFF(turnPntBit == "Hi",H,L); barArr[1] = 0; turnPntArr[1] = turnPntBit; If turnPntArr[1][1] <> turnPntArr[1][0] Then{ TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]); if turnPntArr[1][0]=="Hi" Then{ buy(); } if turnPntArr[1][0] =="Lo" Then{ sell(); } } Else TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); } } TL_SetSize(TL1,1); TL_SetColor(TL1,black);
지표
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2020-08-21 11:50:56

안녕하세요 예스스탁입니다. 좌우로 하나씩 추가해 드립니다. Input:chngRate(0.1); Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),TL2(0),TL3(0); Array:valArr[10](0),barArr[10](0),turnPntArr[10](""); For j = 0 To 9 { barArr[j] = barArr[j] + 1; } Condition1 = Min(valArr[1],valArr[2]) * (1 + (chngRate/100)) < H and lastHiVal < H; Condition2 = Max(valArr[1],valArr[2]) * (1 - (chngRate/100)) > L and (lastLoVal > L || lastLoVal == 0); If Condition1 Then { lastHiVal = H; lastLoVal = 0; } If Condition2 Then { lastLoVal = L; lastHiVal = 0; } turnPntBit = ""; If Condition1 and Condition2 Then { If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then turnPntBit = "HiLo"; Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi"; Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo"; } Else If Condition1 Then turnPntBit = "Hi"; Else If Condition2 Then turnPntBit = "Lo"; If turnPntBit <> "" Then { If turnPntBit == "HiLo" Then { valArr[1] = IFF(turnPntArr[1] == "Hi",H,L); barArr[1] = 0; TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); TL_SetEnd(TL2,sDate[barArr[1]+1],sTime[barArr[1]+1],valArr[1]); #TL_SetEnd(TL3,sDate[barArr[1]-1],sTime[barArr[1]-1],valArr[1]); If turnPntArr[1] == "Hi" Then turnPntBit = "Lo"; Else turnPntBit = "Hi"; } If turnPntBit <> turnPntArr[1] Then { for j = 8 downto 1 { valArr[j+1] = valArr[j]; barArr[j+1] = barArr[j]; turnPntArr[j+1] = turnPntArr[j]; } } If turnPntBit <> turnPntArr[1] or (turnPntBit == turnPntArr[1] and ((turnPntBit == "Hi" and valArr[1] < H) or (turnPntBit == "Lo" and valArr[1] > L))) Then { valArr[1] = IFF(turnPntBit == "Hi",H,L); barArr[1] = 0; turnPntArr[1] = turnPntBit; If turnPntArr[1][1] <> turnPntArr[1][0] Then{ TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]); TL2 = TL_New(sDate[barArr[2]+1],sTime[barArr[2]+1],valArr[2],sDate[barArr[1]+1],sTime[barArr[1]+1],valArr[1]); TL3 = TL_New(sDate[barArr[2]-1],sTime[barArr[2]-1],valArr[2],NextBarSdate,NextBarStime,valArr[1]); if turnPntArr[1][0]=="Hi" Then{ buy(); } if turnPntArr[1][0] =="Lo" Then{ sell(); } } Else { TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); TL_SetEnd(TL2,sDate[barArr[1]+1],sTime[barArr[1]+1],valArr[1]); TL_SetEnd(TL3,NextBarSdate,NextBarStime,valArr[1]); } } } TL_SetSize(TL1,1); TL_SetColor(TL1,black); 즐거운 하루되세요 > blueo 님이 쓴 글입니다. > 제목 : 지표문의 드립니다. > 안녕하세요 지그재그 지표를 찾던 중 수식지왕님의 지그재그 지표를 봤으며 아래와 같은 문의를 드립니다. 1. 똑같은 지그재그 선을 하나더 왼쪽이나 오른쪽으로 옮겨서 표시를 하고 싶습니다. 아래 수식 지왕님의 수식 중에 어떻게 해야 그렇게 표시되는지 부탁 드립니다. 감사 합니다. Input:chngRate(0.1); Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0); Array:valArr[10](0),barArr[10](0),turnPntArr[10](""); For j = 0 To 9 { barArr[j] = barArr[j] + 1; } Condition1 = Min(valArr[1],valArr[2]) * (1 + (chngRate/100)) < H and lastHiVal < H; Condition2 = Max(valArr[1],valArr[2]) * (1 - (chngRate/100)) > L and (lastLoVal > L || lastLoVal == 0); If Condition1 Then { lastHiVal = H; lastLoVal = 0; } If Condition2 Then { lastLoVal = L; lastHiVal = 0; } turnPntBit = ""; If Condition1 and Condition2 Then { If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then turnPntBit = "HiLo"; Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi"; Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo"; } Else If Condition1 Then turnPntBit = "Hi"; Else If Condition2 Then turnPntBit = "Lo"; If turnPntBit <> "" Then { If turnPntBit == "HiLo" Then { valArr[1] = IFF(turnPntArr[1] == "Hi",H,L); barArr[1] = 0; TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); If turnPntArr[1] == "Hi" Then turnPntBit = "Lo"; Else turnPntBit = "Hi"; } If turnPntBit <> turnPntArr[1] Then { for j = 8 downto 1 { valArr[j+1] = valArr[j]; barArr[j+1] = barArr[j]; turnPntArr[j+1] = turnPntArr[j]; } } If turnPntBit <> turnPntArr[1] or (turnPntBit == turnPntArr[1] and ((turnPntBit == "Hi" and valArr[1] < H) or (turnPntBit == "Lo" and valArr[1] > L))) Then { valArr[1] = IFF(turnPntBit == "Hi",H,L); barArr[1] = 0; turnPntArr[1] = turnPntBit; If turnPntArr[1][1] <> turnPntArr[1][0] Then{ TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]); if turnPntArr[1][0]=="Hi" Then{ buy(); } if turnPntArr[1][0] =="Lo" Then{ sell(); } } Else TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); } } TL_SetSize(TL1,1); TL_SetColor(TL1,black);
프로필 이미지

blueo

2020-08-21 21:57:03

답변 감사드립니다. 하나 더 여쭤 볼것이 있는데 제가 원하는 만큼뒤로는 조정이 가능한데 앞으로는 어떻게 표시해야 되는지 문의 드립니다. NextBarSdate,NextBarStime 이거 대신 어떤 것을 써야되는지 해서요 미리 감사 드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 지표문의 드립니다. > 안녕하세요 예스스탁입니다. 좌우로 하나씩 추가해 드립니다. Input:chngRate(0.1); Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0),TL2(0),TL3(0); Array:valArr[10](0),barArr[10](0),turnPntArr[10](""); For j = 0 To 9 { barArr[j] = barArr[j] + 1; } Condition1 = Min(valArr[1],valArr[2]) * (1 + (chngRate/100)) < H and lastHiVal < H; Condition2 = Max(valArr[1],valArr[2]) * (1 - (chngRate/100)) > L and (lastLoVal > L || lastLoVal == 0); If Condition1 Then { lastHiVal = H; lastLoVal = 0; } If Condition2 Then { lastLoVal = L; lastHiVal = 0; } turnPntBit = ""; If Condition1 and Condition2 Then { If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then turnPntBit = "HiLo"; Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi"; Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo"; } Else If Condition1 Then turnPntBit = "Hi"; Else If Condition2 Then turnPntBit = "Lo"; If turnPntBit <> "" Then { If turnPntBit == "HiLo" Then { valArr[1] = IFF(turnPntArr[1] == "Hi",H,L); barArr[1] = 0; TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); TL_SetEnd(TL2,sDate[barArr[1]+1],sTime[barArr[1]+1],valArr[1]); #TL_SetEnd(TL3,sDate[barArr[1]-1],sTime[barArr[1]-1],valArr[1]); If turnPntArr[1] == "Hi" Then turnPntBit = "Lo"; Else turnPntBit = "Hi"; } If turnPntBit <> turnPntArr[1] Then { for j = 8 downto 1 { valArr[j+1] = valArr[j]; barArr[j+1] = barArr[j]; turnPntArr[j+1] = turnPntArr[j]; } } If turnPntBit <> turnPntArr[1] or (turnPntBit == turnPntArr[1] and ((turnPntBit == "Hi" and valArr[1] < H) or (turnPntBit == "Lo" and valArr[1] > L))) Then { valArr[1] = IFF(turnPntBit == "Hi",H,L); barArr[1] = 0; turnPntArr[1] = turnPntBit; If turnPntArr[1][1] <> turnPntArr[1][0] Then{ TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]); TL2 = TL_New(sDate[barArr[2]+1],sTime[barArr[2]+1],valArr[2],sDate[barArr[1]+1],sTime[barArr[1]+1],valArr[1]); TL3 = TL_New(sDate[barArr[2]-1],sTime[barArr[2]-1],valArr[2],NextBarSdate,NextBarStime,valArr[1]); if turnPntArr[1][0]=="Hi" Then{ buy(); } if turnPntArr[1][0] =="Lo" Then{ sell(); } } Else { TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); TL_SetEnd(TL2,sDate[barArr[1]+1],sTime[barArr[1]+1],valArr[1]); TL_SetEnd(TL3,NextBarSdate,NextBarStime,valArr[1]); } } } TL_SetSize(TL1,1); TL_SetColor(TL1,black); 즐거운 하루되세요 > blueo 님이 쓴 글입니다. > 제목 : 지표문의 드립니다. > 안녕하세요 지그재그 지표를 찾던 중 수식지왕님의 지그재그 지표를 봤으며 아래와 같은 문의를 드립니다. 1. 똑같은 지그재그 선을 하나더 왼쪽이나 오른쪽으로 옮겨서 표시를 하고 싶습니다. 아래 수식 지왕님의 수식 중에 어떻게 해야 그렇게 표시되는지 부탁 드립니다. 감사 합니다. Input:chngRate(0.1); Var:j(0),lastHiVal(0),lastLoVal(0),turnPntBit(""),TL1(0); Array:valArr[10](0),barArr[10](0),turnPntArr[10](""); For j = 0 To 9 { barArr[j] = barArr[j] + 1; } Condition1 = Min(valArr[1],valArr[2]) * (1 + (chngRate/100)) < H and lastHiVal < H; Condition2 = Max(valArr[1],valArr[2]) * (1 - (chngRate/100)) > L and (lastLoVal > L || lastLoVal == 0); If Condition1 Then { lastHiVal = H; lastLoVal = 0; } If Condition2 Then { lastLoVal = L; lastHiVal = 0; } turnPntBit = ""; If Condition1 and Condition2 Then { If Max(valArr[1],valArr[2]) < H and Min(valArr[1],valArr[2]) > L Then turnPntBit = "HiLo"; Else If Max(valArr[1],valArr[2]) < H Then turnPntBit = "Hi"; Else If Min(valArr[1],valArr[2]) > L Then turnPntBit = "Lo"; } Else If Condition1 Then turnPntBit = "Hi"; Else If Condition2 Then turnPntBit = "Lo"; If turnPntBit <> "" Then { If turnPntBit == "HiLo" Then { valArr[1] = IFF(turnPntArr[1] == "Hi",H,L); barArr[1] = 0; TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); If turnPntArr[1] == "Hi" Then turnPntBit = "Lo"; Else turnPntBit = "Hi"; } If turnPntBit <> turnPntArr[1] Then { for j = 8 downto 1 { valArr[j+1] = valArr[j]; barArr[j+1] = barArr[j]; turnPntArr[j+1] = turnPntArr[j]; } } If turnPntBit <> turnPntArr[1] or (turnPntBit == turnPntArr[1] and ((turnPntBit == "Hi" and valArr[1] < H) or (turnPntBit == "Lo" and valArr[1] > L))) Then { valArr[1] = IFF(turnPntBit == "Hi",H,L); barArr[1] = 0; turnPntArr[1] = turnPntBit; If turnPntArr[1][1] <> turnPntArr[1][0] Then{ TL1 = TL_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],sDate[barArr[1]],sTime[barArr[1]],valArr[1]); if turnPntArr[1][0]=="Hi" Then{ buy(); } if turnPntArr[1][0] =="Lo" Then{ sell(); } } Else TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); } } TL_SetSize(TL1,1); TL_SetColor(TL1,black);