커뮤니티

부탁 드립니다.

프로필 이미지
yes
2015-10-20 07:11:10
216
글번호 91440
답변완료

첨부 이미지

언제나 만족한 수식 답변 노고에 깊이 감사 드립니다. 다음 파동에서 그림과 같이 질문1)ABCD표시 부탁 드립니다. 질문2) 점 C와 D의 중간 지점에서 (초기에)생성된 수평선이 선분 CD가 성장함에 따라 중간 지점이 연동이 되지 않고 머물러 있습니다. 변동 되도록 수정 부탁 드립니다. 미리 깊이 깊이 감사 드립니다. 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]); Else TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); } } TL_SetSize(TL1,1); TL_SetColor(TL1,black); var : AA(0),BB(0),CC(0),DD(0); var : TL59(0); if turnPntBit=="Hi" and turnPntArr[1][1] <> turnPntArr[1][0] Then{ AA = valarr[1]; BB = valarr[2]; CC = valarr[3]; DD = valarr[4]; TL_Delete(TL59); TL59 = TL_New(sdate[1],stime[1],(AA+BB)/2,sdate,stime,(AA+BB)/2); TL_SetExtRight(TL59,true); TL_SetColor(TL59,red); TL_SetSize(TL59,5); } if turnPntBit=="Lo" and turnPntArr[1][1] <> turnPntArr[1][0] Then{ AA = valarr[1]; BB = valarr[2]; CC = valarr[3]; DD = valarr[4]; TL_Delete(TL59); TL_Delete(TL59); TL59 = TL_New(sdate[1],stime[1],(AA+BB)/2,sdate,stime,(AA+BB)/2); TL_SetExtRight(TL59,true); TL_SetColor(TL59,red); TL_SetSize(TL59,5); }
지표
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2015-10-20 10:54:28

안녕하세요 예스스탁입니다. 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]); Else TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); } } TL_SetSize(TL1,1); TL_SetColor(TL1,black); var : AA(0),BB(0),CC(0),DD(0); var : TL59(0),Tx11(0),tx12(0),tx13(0),tx14(0); if turnPntBit=="Hi" Then{ AA = valarr[1]; BB = valarr[2]; CC = valarr[3]; DD = valarr[4]; TL_Delete(TL59); TL59 = TL_New(sdate[1],stime[1],(AA+BB)/2,sdate,stime,(AA+BB)/2); TL_SetExtRight(TL59,true); TL_SetColor(TL59,red); TL_SetSize(TL59,5); Text_Delete(Tx11); Tx11 = Text_New(sDate[barArr[1]],sTime[barArr[1]],valArr[1],NumToStr(valArr[1],2)); Text_SetStyle(tx11,2,2); if turnPntArr[1][1] <> turnPntArr[1][0] then{ Text_Delete(Tx12); Text_Delete(Tx13); Text_Delete(Tx14); Tx11 = Text_New(sDate[barArr[1]],sTime[barArr[1]],valArr[1],NumToStr(valArr[1],2)); Tx12 = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],NumToStr(valArr[2],2)); Tx13 = Text_New(sDate[barArr[3]],sTime[barArr[3]],valArr[3],NumToStr(valArr[3],2)); Tx14 = Text_New(sDate[barArr[4]],sTime[barArr[4]],valArr[4],NumToStr(valArr[4],2)); Text_SetStyle(tx12,2,2); Text_SetStyle(tx13,2,2); Text_SetStyle(tx14,2,2); } } if turnPntBit=="Lo" Then{ AA = valarr[1]; BB = valarr[2]; CC = valarr[3]; DD = valarr[4]; TL_Delete(TL59); TL_Delete(TL59); TL59 = TL_New(sdate[1],stime[1],(AA+BB)/2,sdate,stime,(AA+BB)/2); TL_SetExtRight(TL59,true); TL_SetColor(TL59,red); TL_SetSize(TL59,5); Text_Delete(Tx11); Tx11 = Text_New(sDate[barArr[1]],sTime[barArr[1]],valArr[1],NumToStr(valArr[1],2)); Text_SetStyle(tx11,2,2); if turnPntArr[1][1] <> turnPntArr[1][0] then{ Text_Delete(Tx12); Text_Delete(Tx13); Text_Delete(Tx14); Tx12 = Text_New(sDate[barArr[2]],sTime[barArr[2]],valArr[2],NumToStr(valArr[2],2)); Tx13 = Text_New(sDate[barArr[3]],sTime[barArr[3]],valArr[3],NumToStr(valArr[3],2)); Tx14 = Text_New(sDate[barArr[4]],sTime[barArr[4]],valArr[4],NumToStr(valArr[4],2)); Text_SetStyle(tx12,2,2); Text_SetStyle(tx13,2,2); Text_SetStyle(tx14,2,2); } } 즐거운 하루되세요 > yes 님이 쓴 글입니다. > 제목 : 부탁 드립니다. > 언제나 만족한 수식 답변 노고에 깊이 감사 드립니다. 다음 파동에서 그림과 같이 질문1)ABCD표시 부탁 드립니다. 질문2) 점 C와 D의 중간 지점에서 (초기에)생성된 수평선이 선분 CD가 성장함에 따라 중간 지점이 연동이 되지 않고 머물러 있습니다. 변동 되도록 수정 부탁 드립니다. 미리 깊이 깊이 감사 드립니다. 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]); Else TL_SetEnd(TL1,sDate[barArr[1]],sTime[barArr[1]],valArr[1]); } } TL_SetSize(TL1,1); TL_SetColor(TL1,black); var : AA(0),BB(0),CC(0),DD(0); var : TL59(0); if turnPntBit=="Hi" and turnPntArr[1][1] <> turnPntArr[1][0] Then{ AA = valarr[1]; BB = valarr[2]; CC = valarr[3]; DD = valarr[4]; TL_Delete(TL59); TL59 = TL_New(sdate[1],stime[1],(AA+BB)/2,sdate,stime,(AA+BB)/2); TL_SetExtRight(TL59,true); TL_SetColor(TL59,red); TL_SetSize(TL59,5); } if turnPntBit=="Lo" and turnPntArr[1][1] <> turnPntArr[1][0] Then{ AA = valarr[1]; BB = valarr[2]; CC = valarr[3]; DD = valarr[4]; TL_Delete(TL59); TL_Delete(TL59); TL59 = TL_New(sdate[1],stime[1],(AA+BB)/2,sdate,stime,(AA+BB)/2); TL_SetExtRight(TL59,true); TL_SetColor(TL59,red); TL_SetSize(TL59,5); }
프로필 이미지

yes

2015-10-20 11:45:24

yes 님에 의해 삭제된 답변입니다.