커뮤니티
문의드립니다.
2015-11-19 09:19:15
201
글번호 92542
지금까지 친절하게 답변해주신 식을 바탕으로 질문 드립니다.
N일전의 14시 50분의 종가가 N+1일 전의 종가보다 15퍼센트 상승했으면서 상한가가 아닌 종목을, N일전의 종가의 거래량과 함께 찾고 싶습니다. 상한가폭이 30퍼센트로 확대된 20150615부터 찾으려고 합니다. 다음의 식이 맞는지 궁금합니다. 감사합니다.
input : N(2);
var : cnt(0);
var : 상한가(0),uplimit(0),cnt(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
Array : V1[20](0),V2[20](0);
Array : upv[100](0),DD[100](0);
if date != date[1] Then{
V1[0] = 0;
V2[0] = 0;
for cnt = 1 to 19{
V1[cnt] = V1[cnt-1][1];
V2[cnt] = V2[cnt-1][1];
}
}
if stime == 144500 Then
V1[0] = C;
if stime == 150000 Then
V2[0] = m;
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else if date >= 20050328 and date < 20150615 Then
UpLimit = (BP[0] * 1.15);
Else
UpLimit = (BP[0] * 1.30);
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;
up7 = int(UpLimit/1+0.00001)*1;
}
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;
up7 = int(UpLimit/1+0.00001)*1;
}
}
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;
up7 = int(UpLimit/1+0.00001)*1;
}
if CodeCategory() == 1 || CodeCategory() == 2 then {
if sdate < 20101004 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 If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up6);
}
Else{
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 If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up7);
}
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
upv[0] = 상한가;
if date != date[1] Then{
DD[0] = sdate;
for cnt = 1 to 300{
upv[cnt] = upv[cnt-1][1];
DD[cnt] = DD[cnt-1];
}
}
if V1[N] > 0 and upLimit[n] > 0 and V1[N] >= DayClose(N+1)*1.15 and V1[N]<upLimit[n]
and dd[n] >=20150615 then
find(V2[N]);
답변 1
예스스탁 예스스탁 답변
2015-11-19 13:03:37
안녕하세요
예스스탁입니다.
변수에 cnt가 중복으로 선언되어 있어
하나는 선언에서 삭제했습니다.
나머지 내용은 이상이 없습니다.
검색시 속성화면에서 검색에 필요한 최소기간에
500봉으로 지정하고 검색하셔야 합니다.
또한 해당 식은 분봉에서 검색하셔야 합니다.
종목검색은 최대 500봉까지만 제공이 되어
분봉에서 날짜수로 며칠이 되지 않으므로
위 사항 유의하셔서 사용하시는 분봉주기에서
500봉 이내의 N일전으로만 지정하고 검색하셔야 합니다.
input : N(2);
var : cnt(0);
var : 상한가(0),uplimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
Array : V1[20](0),V2[20](0);
Array : upv[100](0),DD[100](0);
if date != date[1] Then{
V1[0] = 0;
V2[0] = 0;
for cnt = 1 to 19{
V1[cnt] = V1[cnt-1][1];
V2[cnt] = V2[cnt-1][1];
}
}
if stime == 144500 Then
V1[0] = C;
if stime == 150000 Then
V2[0] = m;
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else if date >= 20050328 and date < 20150615 Then
UpLimit = (BP[0] * 1.15);
Else
UpLimit = (BP[0] * 1.30);
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;
up7 = int(UpLimit/1+0.00001)*1;
}
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;
up7 = int(UpLimit/1+0.00001)*1;
}
}
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;
up7 = int(UpLimit/1+0.00001)*1;
}
if CodeCategory() == 1 || CodeCategory() == 2 then {
if sdate < 20101004 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 If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up6);
}
Else{
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 If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up7);
}
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
upv[0] = 상한가;
if date != date[1] Then{
DD[0] = sdate;
for cnt = 1 to 300{
upv[cnt] = upv[cnt-1][1];
DD[cnt] = DD[cnt-1];
}
}
if V1[N] > 0 and
upLimit[n] > 0 and
V1[N] >= DayClose(N+1)*1.15 and
V1[N]<upLimit[n] and
dd[n] >=20150615 then
find(V2[N]);
즐거운 하루되세요
> rayleigh 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 지금까지 친절하게 답변해주신 식을 바탕으로 질문 드립니다.
N일전의 14시 50분의 종가가 N+1일 전의 종가보다 15퍼센트 상승했으면서 상한가가 아닌 종목을, N일전의 종가의 거래량과 함께 찾고 싶습니다. 상한가폭이 30퍼센트로 확대된 20150615부터 찾으려고 합니다. 다음의 식이 맞는지 궁금합니다. 감사합니다.
input : N(2);
var : cnt(0);
var : 상한가(0),uplimit(0),cnt(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
Array : V1[20](0),V2[20](0);
Array : upv[100](0),DD[100](0);
if date != date[1] Then{
V1[0] = 0;
V2[0] = 0;
for cnt = 1 to 19{
V1[cnt] = V1[cnt-1][1];
V2[cnt] = V2[cnt-1][1];
}
}
if stime == 144500 Then
V1[0] = C;
if stime == 150000 Then
V2[0] = m;
if date >= 19981207 then {
if date < 20050328 && CodeCategory() == 2 then
UpLimit = (BP[0] * 1.12);
Else if date >= 20050328 and date < 20150615 Then
UpLimit = (BP[0] * 1.15);
Else
UpLimit = (BP[0] * 1.30);
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;
up7 = int(UpLimit/1+0.00001)*1;
}
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;
up7 = int(UpLimit/1+0.00001)*1;
}
}
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;
up7 = int(UpLimit/1+0.00001)*1;
}
if CodeCategory() == 1 || CodeCategory() == 2 then {
if sdate < 20101004 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 If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up6);
}
Else{
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 If BP >= 1000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=1000, up6, up7);
}
}
else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF
상한가 = up6;
}
}
upv[0] = 상한가;
if date != date[1] Then{
DD[0] = sdate;
for cnt = 1 to 300{
upv[cnt] = upv[cnt-1][1];
DD[cnt] = DD[cnt-1];
}
}
if V1[N] > 0 and upLimit[n] > 0 and V1[N] >= DayClose(N+1)*1.15 and V1[N]<upLimit[n]
and dd[n] >=20150615 then
find(V2[N]);