커뮤니티

검색식 부탁드립니다.

프로필 이미지
디아리
2004-09-22 19:14:43
1178
글번호 5225
답변완료
N일 x% 상승후 N일 상승한 주가의 y%이내에서 횡보한 검색식을 만들려고 합니다. 예로 5일전 10%의 상승한 후에 이후 주가가 5일전 주가대비 +-3%내에서 움직인 종목을 검색하려 합니다. 그리고 아래식을 작성해 보았는데, 오류는 없으나 종목 검색이 안나오는데 잘못된 부분좀 설명 부탁드립니다. Input : lowpercent(0.97),highpercent(1.13); var : count(0); for count = 5 downto 1 1 If c[(count)-1] >= c[count]*1.115 then {if count == 5 then {if c[3] >= c[4]*lowpercent && c[3]<= c[4]*highpercent then {if c[2] >= c[3]*lowpercent && c[2]<= c[3]*highpercent then {if c[1] >= c[2]*lowpercent && c[1]<= c[2]*highpercent then {if c[0] >= c[1]*lowpercent && c[0]<= c[1]*highpercent then var1=1;}}}} else {if count == 4 then {if c[2] >= c[3]*lowpercent && c[2]<= c[3]*highpercent then {if c[1] >= c[2]*lowpercent && c[1]<= c[2]*highpercent then {if c[0] >= c[1]*lowpercent && c[0]<= c[1]*highpercent then var1=1;}}} else {if count == 3 then {if c[1] >= c[2]*lowpercent && c[1]<= c[2]*highpercent then {if c[0] >= c[1]*lowpercent && c[0]<= c[1]*highpercent then var1=1;}} else {if count == 2 then {if c[0] >= c[1]*lowpercent && c[0]<= c[1]*highpercent then var1=1;} else {if count==1 then var1 = 0; else var1 = 0;}}}}} else var1=0; find(var1);
검색
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2004-09-23 14:53:37

안녕하세요 예스스탁입니다. 문의하신 식은 다음과 같습니다. input : N(5),UPper(1.10), Downper(0.90); if C[N] >= c[N+1]*1.1 and C[N]*UPper >= max(c[N-1],c[N-2],c[N-3],c[N-4], c) and c[n]*Downper <= min(c[N-1],c[N-2],c[N-3],c[N-4], c) then var1 = 1; else var1 = 0; find(var1); %값을 조정하여 검색해 보시기 바랍니다. 상하 10%로 설정되어 있습니다. 즐거운 하루되세요 > 디아리 님이 쓴 글입니다. > 제목 : 검색식 부탁드립니다. > N일 x% 상승후 N일 상승한 주가의 y%이내에서 횡보한 검색식을 만들려고 합니다. 예로 5일전 10%의 상승한 후에 이후 주가가 5일전 주가대비 +-3%내에서 움직인 종목을 검색하려 합니다. 그리고 아래식을 작성해 보았는데, 오류는 없으나 종목 검색이 안나오는데 잘못된 부분좀 설명 부탁드립니다. Input : lowpercent(0.97),highpercent(1.13); var : count(0); for count = 5 downto 1 1 If c[(count)-1] >= c[count]*1.115 then {if count == 5 then {if c[3] >= c[4]*lowpercent && c[3]<= c[4]*highpercent then {if c[2] >= c[3]*lowpercent && c[2]<= c[3]*highpercent then {if c[1] >= c[2]*lowpercent && c[1]<= c[2]*highpercent then {if c[0] >= c[1]*lowpercent && c[0]<= c[1]*highpercent then var1=1;}}}} else {if count == 4 then {if c[2] >= c[3]*lowpercent && c[2]<= c[3]*highpercent then {if c[1] >= c[2]*lowpercent && c[1]<= c[2]*highpercent then {if c[0] >= c[1]*lowpercent && c[0]<= c[1]*highpercent then var1=1;}}} else {if count == 3 then {if c[1] >= c[2]*lowpercent && c[1]<= c[2]*highpercent then {if c[0] >= c[1]*lowpercent && c[0]<= c[1]*highpercent then var1=1;}} else {if count == 2 then {if c[0] >= c[1]*lowpercent && c[0]<= c[1]*highpercent then var1=1;} else {if count==1 then var1 = 0; else var1 = 0;}}}}} else var1=0; find(var1);