커뮤니티
종목검색식
2012-02-21 18:06:43
310
글번호 48027
안녕하세요
15일이내 상한가가없고 8%이상에서 15% 상승종목검색식 이 안되는것같아요 검토해주세요
그리고 행마다 설명 부탁드립니다.
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0);
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else
UpLimit = (BP[0] * 1.15);
if CodeCategory() == 2 then {
if date >= 20030721 then {
up1 = int(UpLimit/100+0.00001)*100;
up2 = int(UpLimit/100+0.00001)*100;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
}
else {
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/10+0.00001)*10;
}
}
Else {
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
}
if CodeCategory() == 1 || CodeCategory() == 2 then {
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else
상한가 = iff(up6>=5000, up5, up6);
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
if countif(H >= 상한가,15) == 0 And
C >= dayopen*1.05 and c <= dayopen*1.15 Then
find(1);
답변 1
예스스탁 예스스탁 답변
2012-02-22 10:14:50
안녕하세요
예스스탁입니다.
검색하실 때 검색에 필요한 최소기간을
50정도로 설정하시고 검색하시면 됩니다.
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0);
if date >= 19981207 then { #1998년 12월 8일 이후
#코드닥은 2005년 3월 28일 이전은 기준가대비 12% 이후는 15%
#코드닥이 아니면 기준가대비 15%
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else
UpLimit = (BP[0] * 1.15);
#각 종목은 호가단위가 있고 단순히 당일 상한가는 기준가 대비 12%나 15%로 한 값을
#넘지 않는 최대 호가이므로 아래와 같이 가격별로 호가단위에 맞게 계산한 내용입니다.
if CodeCategory() == 2 then {#코스닥일 경우
if date >= 20030721 then {#2003년7월21일 이후에는
up1 = int(UpLimit/100+0.00001)*100; #호가단위 100원
up2 = int(UpLimit/100+0.00001)*100; #호가단위 100원
up3 = int(UpLimit/100+0.00001)*100; #호가단위 100원
up4 = int(UpLimit/50+0.00001)*50; #호가단위 50원
up5 = int(UpLimit/10+0.00001)*10; #호가단위 10원
up6 = int(UpLimit/5+0.00001)*5; #호가단위 5원
}
else {#2003년7월21일 이전
up1 = int(UpLimit/1000+0.00001)*1000; #호가단위 1000원
up2 = int(UpLimit/500+0.00001)*500; #호가단위 500원
up3 = int(UpLimit/100+0.00001)*100; #호가단위 100원
up4 = int(UpLimit/50+0.00001)*50; #호가단위 50원
up5 = int(UpLimit/10+0.00001)*10; #호가단위 10원
up6 = int(UpLimit/10+0.00001)*10; #호가단위 10원
}
}
Else { #코스닥이 아닌
up1 = int(UpLimit/1000+0.00001)*1000; #호가단위 1000원
up2 = int(UpLimit/500+0.00001)*500;#호가단위 500원
up3 = int(UpLimit/100+0.00001)*100; #호가단위 1000원
up4 = int(UpLimit/50+0.00001)*50;#호가단위 50원
up5 = int(UpLimit/10+0.00001)*10;#호가단위 10원
up6 = int(UpLimit/5+0.00001)*5; #호가단위 5원
}
#코스피종목이거나 코스닥종목이면
if CodeCategory() == 1 || CodeCategory() == 2 then {
If BP >= 500000 Then #기준가가 50만원 이상이면 상한가는 up1
상한가 = up1;
Else If BP >= 100000 Then #기준가가 10만원 이상이고 up2가 50만원 이상이면 상한가는 up1, 아니면 up2
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then #기준가가 5만원 이상이고 up3이 10만원 이상이면 상한가는 up2, 아니면 up3
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then #기준가가 1만원 이상이고 up4가 5만원 이상이면 상한가는 up3, 아니면 up4
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then #기준가가 5천원 이상이고 up5가 1만원 이상이면 상한가는 up4, 아니면 up5
상한가 = iff(up5>=10000, up4, up5);
Else #그 외에는 up6이 5천원 이상이면 상한가는 up5, 아니면 up6
상한가 = iff(up6>=5000, up5, up6);
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
#15일간 상한가를 기록한 적이 없고
#현재가는 시가대비 5%이상 15% 이하인 종목
if countif(H >= 상한가,15) == 0 And
C >= dayopen*1.05 and c <= dayopen*1.15 Then
find(1);
즐거운 하루되세요
> 외국인 님이 쓴 글입니다.
> 제목 : 종목검색식
> 안녕하세요
15일이내 상한가가없고 8%이상에서 15% 상승종목검색식 이 안되는것같아요 검토해주세요
그리고 행마다 설명 부탁드립니다.
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0);
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else
UpLimit = (BP[0] * 1.15);
if CodeCategory() == 2 then {
if date >= 20030721 then {
up1 = int(UpLimit/100+0.00001)*100;
up2 = int(UpLimit/100+0.00001)*100;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
}
else {
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/10+0.00001)*10;
}
}
Else {
up1 = int(UpLimit/1000+0.00001)*1000;
up2 = int(UpLimit/500+0.00001)*500;
up3 = int(UpLimit/100+0.00001)*100;
up4 = int(UpLimit/50+0.00001)*50;
up5 = int(UpLimit/10+0.00001)*10;
up6 = int(UpLimit/5+0.00001)*5;
}
if CodeCategory() == 1 || CodeCategory() == 2 then {
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 100000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=100000, up2, up3);
Else If BP >= 10000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=10000, up4, up5);
Else
상한가 = iff(up6>=5000, up5, up6);
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
if countif(H >= 상한가,15) == 0 And
C >= dayopen*1.05 and c <= dayopen*1.15 Then
find(1);
다음글
이전글