커뮤니티

질문 부탁드립니다

프로필 이미지
yamu
2025-06-04 09:35:22
167
글번호 191368
답변완료
도움에 늘 감사드립니다 질문 몇 가지 부탁드립니다 질문1) find 함수 관련인데요 아래 식처럼 작성을 하면 (분봉상에서) 현재봉이 if에 해당되거나 else 에 해당되는 종목을 찾는게 맞나요?? 마지막에 if condition1==true and condition2==true then find(1); 이 부분을 어디에 위치 시켜야 하는지 알고싶습니다 (수식은 필요한 부분만 포함시켜서 간소화했습니다) if (h>l*1.08) then { ... if h>aa[0] Then condition1=true; } else { if h>aa[0]*1.1 Then condition2=true; } if Bdate != Bdate[1] Then Condition3 = False; if condition3==False and condition1==true and condition2==true Then { condition3=true; find(1) } 질문2) 아래 식처럼 countif 를 이용해 검색을 하게 되면 if countif(condition1==true and condition2==true,50) >1 then find(1); 이라고 작성하게 되면 만약 현재봉에서 30봉전 부터는 직전 조건만족 범위에 속하게 된다면 고가값들을 현재 기준으로 봤을때 aa[1] 과 비교하게 되는건가요? (계속 aa[0] 와 비교하는게 아니고) 그렇다면 혹시 계속 aa[0]나 특정시점의 aa[] (예를들어 aa[2]) 와 비교하게 작성할 수도 있나요? # 식에서 틀린 부분이 있다면 수정해주시면 감사하겠습니다 if (h>l*1.08) then { ... if h>aa[0] Then condition1=true; } else { if h>aa[0]*1.1 Then condition2=true; } if Bdate != Bdate[1] Then Condition3 = False; if condition3==False and countif(condition1==true and condition2==true,50) >1 Then { condition3=true; find(1) } 질문3) for 문 관련인데요 아래와 같이 작성하면 최초만족시에 값들을 저장하는데요 만약에 두번째 만족 할때까지의 값들을 저장하려면 어떻게 작성하면 될까요? if cnt==1, if cnt==2 로 나눠서 작성하면 될까요? 각각 값들을 따로 저장하려고 합니다 최초 만족 (value1 ~ value3 ) , 두번째 만족 (value4 ~ value6) for cnt = 1 to (var1-var2) { if h[cnt]>var3 then { value1= h[cnt]; value2=sdate[cnt]; value3=stime[cnt]; cnt=(var1-var2)+1; } } 감사합니다
검색
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2025-06-04 10:31:46

안녕하세요 예스스탁입니다. 1 작성하신 내용과 같이 하단에 위치하면 됩니다. 다만 변수는 값이 한번 저장되면 계속 유지가 됩니다. 올리신 수식에서 condition1,condition2는 한번 true가 저장되면 계속 true입니다. condition1,condition2가 false로 초기화 되는 내용을 추가하셔야 합니다. 2 countif(condition1==true and condition2==true,50) 해당 수식은 단순히 최근 50봉안에 condition1==true and condition2==true 조건이 만족한 갯수를 리턴합니다. 매봉 h>aa[0], h>aa[0]*1.10 조건에 해당되는지 보는것과 같습니다. 배열변수를 사용한다고 해서 해당 배열의 방전호가 자동으로 증가하거나 하는 것이 아니니다. 3 조건만족 횟수 카운트 해서 횟수별로 지정해 주셔야 합니다. cnt=(var1-var2)+1;는 한번 만족하면 for문을 빠져나가게 합니다. 두번체크해야 하므로 해당 count = 0; for cnt = 1 to (var1-var2) { if h[cnt]>var3 then { count = count+1; if count == 1 Then { value1= h[cnt]; value2=sdate[cnt]; value3=stime[cnt]; } if count == 2 Then { value4= h[cnt]; value5=sdate[cnt]; value6=stime[cnt]; cnt=(var1-var2)+1; } } } 즐거운 하루되세요 > yamu 님이 쓴 글입니다. > 제목 : 질문 부탁드립니다 > 도움에 늘 감사드립니다 질문 몇 가지 부탁드립니다 질문1) find 함수 관련인데요 아래 식처럼 작성을 하면 (분봉상에서) 현재봉이 if에 해당되거나 else 에 해당되는 종목을 찾는게 맞나요?? 마지막에 if condition1==true and condition2==true then find(1); 이 부분을 어디에 위치 시켜야 하는지 알고싶습니다 (수식은 필요한 부분만 포함시켜서 간소화했습니다) if (h>l*1.08) then { ... if h>aa[0] Then condition1=true; } else { if h>aa[0]*1.1 Then condition2=true; } if Bdate != Bdate[1] Then Condition3 = False; if condition3==False and condition1==true and condition2==true Then { condition3=true; find(1) } 질문2) 아래 식처럼 countif 를 이용해 검색을 하게 되면 if countif(condition1==true and condition2==true,50) >1 then find(1); 이라고 작성하게 되면 만약 현재봉에서 30봉전 부터는 직전 조건만족 범위에 속하게 된다면 고가값들을 현재 기준으로 봤을때 aa[1] 과 비교하게 되는건가요? (계속 aa[0] 와 비교하는게 아니고) 그렇다면 혹시 계속 aa[0]나 특정시점의 aa[] (예를들어 aa[2]) 와 비교하게 작성할 수도 있나요? # 식에서 틀린 부분이 있다면 수정해주시면 감사하겠습니다 if (h>l*1.08) then { ... if h>aa[0] Then condition1=true; } else { if h>aa[0]*1.1 Then condition2=true; } if Bdate != Bdate[1] Then Condition3 = False; if condition3==False and countif(condition1==true and condition2==true,50) >1 Then { condition3=true; find(1) } 질문3) for 문 관련인데요 아래와 같이 작성하면 최초만족시에 값들을 저장하는데요 만약에 두번째 만족 할때까지의 값들을 저장하려면 어떻게 작성하면 될까요? if cnt==1, if cnt==2 로 나눠서 작성하면 될까요? 각각 값들을 따로 저장하려고 합니다 최초 만족 (value1 ~ value3 ) , 두번째 만족 (value4 ~ value6) for cnt = 1 to (var1-var2) { if h[cnt]>var3 then { value1= h[cnt]; value2=sdate[cnt]; value3=stime[cnt]; cnt=(var1-var2)+1; } } 감사합니다