예스스탁
예스스탁 답변
2023-05-09 13:49:32
안녕하세요
예스스탁입니다.
하한가 계산을 위해 1번 사용자함수를 먼저 만드신 후
2번 종목검색식 작성해서 검색하시기 바랍니다.
1
사용자함수명 : Hoga
반환값형 : 숫자형
input : price(Numeric);
if CodeCategory == 1 Then
{
if date >= 20230125 Then
{
if Price < 2000 Then
Hoga = 1;
if 2000 <= Price and Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 20000 Then
Hoga = 10;
if 20000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 200000 Then
Hoga = 100;
if 200000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
Else
{
if sDate >= 20101004 Then
{
if Price < 1000 Then
Hoga = 1;
if 1000 <= Price and Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 100000 Then
Hoga = 100;
if 100000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
Else
{
if Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 100000 Then
Hoga = 100;
if 100000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
}
}
if CodeCategory == 2 Then
{
if date >= 20230125 Then
{
if Price < 2000 Then
Hoga = 1;
if 2000 <= Price and Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 20000 Then
Hoga = 10;
if 20000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 200000 Then
Hoga = 100;
if 200000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
Else
{
if sDate >= 20101004 Then
{
if Price < 1000 Then
Hoga = 1;
if 1000 <= Price and Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price Then
Hoga = 100;
}
Else
{
if sDate >= 20030721 Then
{
if Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price Then
Hoga = 100;
}
Else
{
if Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 100000 Then
Hoga = 100;
if 100000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
}
}
}
2 종목검색
속성에서 검색에 필요한 최소기간에 넉넉히 310봉 이상 지정하고 검색하시기 바랍니다.
input : per(300);
var : LimitValue(0),vv(0),lv(0),DownLimit(0),v1(0),v2(0);
var : hh(0),hi(0),ll(0),cnt(0);
var : DNlimit(0),Hoga(0),하한가(0);
if date < 20050328 && CodeCategory() == 2 then
LimitValue = (BP*0.12);
Else if date >= 20050328 and date < 20150615 Then
LimitValue = (BP*0.15);
Else
LimitValue = (BP*0.30);
v1 = Hoga(BP);
vv = Floor(LimitValue/v1)*v1;
lv = BP-vv;
v2 = Hoga(lv);
DownLimit = Floor(lv/v2)*v2;
hh = highest(H,300);
hi = NthHighestBar(1,H,300);
ll = lowest(L,300);
Condition1 = False;
for cnt = max(0,hi-3) to hi
{
if DownLimit[cnt] <= 하한가[cnt] Then
Condition1 = true;
}
if var1 >= Var2*(1+per/100) and
Condition1 == true Then
Find(1);
즐거운 하루되세요
> 하루4 님이 쓴 글입니다.
> 제목 : 종목검색을 하고 싶은데요
> 최근 300일 이내에서 최저점보다 최고점이 300%이상인 종목중
최고점에서 3일이내 하한가가 있는 종목을 검색하고 싶습니다
감사합니다
안녕하세요
작성해주신 식으로 검색해봤는데
삼화전자가 검색되어야 하지만 종목이 하나도 안나옵니다
무엇이 잘못되었을까요??
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 종목검색을 하고 싶은데요
>
안녕하세요
예스스탁입니다.
하한가 계산을 위해 1번 사용자함수를 먼저 만드신 후
2번 종목검색식 작성해서 검색하시기 바랍니다.
1
사용자함수명 : Hoga
반환값형 : 숫자형
input : price(Numeric);
if CodeCategory == 1 Then
{
if date >= 20230125 Then
{
if Price < 2000 Then
Hoga = 1;
if 2000 <= Price and Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 20000 Then
Hoga = 10;
if 20000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 200000 Then
Hoga = 100;
if 200000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
Else
{
if sDate >= 20101004 Then
{
if Price < 1000 Then
Hoga = 1;
if 1000 <= Price and Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 100000 Then
Hoga = 100;
if 100000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
Else
{
if Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 100000 Then
Hoga = 100;
if 100000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
}
}
if CodeCategory == 2 Then
{
if date >= 20230125 Then
{
if Price < 2000 Then
Hoga = 1;
if 2000 <= Price and Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 20000 Then
Hoga = 10;
if 20000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 200000 Then
Hoga = 100;
if 200000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
Else
{
if sDate >= 20101004 Then
{
if Price < 1000 Then
Hoga = 1;
if 1000 <= Price and Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price Then
Hoga = 100;
}
Else
{
if sDate >= 20030721 Then
{
if Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price Then
Hoga = 100;
}
Else
{
if Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 100000 Then
Hoga = 100;
if 100000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
}
}
}
2 종목검색
속성에서 검색에 필요한 최소기간에 넉넉히 310봉 이상 지정하고 검색하시기 바랍니다.
input : per(300);
var : LimitValue(0),vv(0),lv(0),DownLimit(0),v1(0),v2(0);
var : hh(0),hi(0),ll(0),cnt(0);
var : DNlimit(0),Hoga(0),하한가(0);
if date < 20050328 && CodeCategory() == 2 then
LimitValue = (BP*0.12);
Else if date >= 20050328 and date < 20150615 Then
LimitValue = (BP*0.15);
Else
LimitValue = (BP*0.30);
v1 = Hoga(BP);
vv = Floor(LimitValue/v1)*v1;
lv = BP-vv;
v2 = Hoga(lv);
DownLimit = Floor(lv/v2)*v2;
hh = highest(H,300);
hi = NthHighestBar(1,H,300);
ll = lowest(L,300);
Condition1 = False;
for cnt = max(0,hi-3) to hi
{
if DownLimit[cnt] <= 하한가[cnt] Then
Condition1 = true;
}
if var1 >= Var2*(1+per/100) and
Condition1 == true Then
Find(1);
즐거운 하루되세요
> 하루4 님이 쓴 글입니다.
> 제목 : 종목검색을 하고 싶은데요
> 최근 300일 이내에서 최저점보다 최고점이 300%이상인 종목중
최고점에서 3일이내 하한가가 있는 종목을 검색하고 싶습니다
감사합니다
예스스탁
예스스탁 답변
2023-05-09 14:42:51
안녕하세요
예스스탁입니다.
변수가 잘못 지정된 부분이 있었습니다.
아래식으로 사용하시면 됩니다.
300봉 최고가의 위치가 최저가보다 나중에 발생했다는 내용도 추가해 드립니다.
불필요한 내용이면 수식내 주석처리 참고하셔서 삭제하시면 됩니다.
input : P(300),per(300);
var : LimitValue(0),vv(0),lv(0),DownLimit(0),v1(0),v2(0);
var : hh(0),hi(0),ll(0),li(0),cnt(0);
if date < 20050328 && CodeCategory() == 2 then
LimitValue = (BP*0.12);
Else if date >= 20050328 and date < 20150615 Then
LimitValue = (BP*0.15);
Else
LimitValue = (BP*0.30);
v1 = Hoga(BP);
vv = Floor(LimitValue/v1)*v1;
lv = BP-vv;
v2 = Hoga(lv);
DownLimit = Floor(lv/v2)*v2;
hh = 0;
ll = 0;
hi = 0;
li = 0;
For cnt = 0 to P-1
{
if hh == 0 or (hh > 0 and h[cnt] > hh) then
{
hh = h[cnt];
hi = cnt;
}
if ll == 0 or (ll > 0 and l[cnt] < ll) then
{
ll = l[cnt];
li = cnt;
}
}
Condition1 = False;
for cnt = max(0,hi-3) to hi
{
if L[cnt] <= DownLimit[cnt] Then
Condition1 = true;
}
if hh >= ll*(1+per/100)
and li > hi #최저점보다 최고점이 나중에 발생(불필요한 조건이면 삭제)
and Condition1 == true Then
Find(1);
즐거운 하루되세요
> 하루4 님이 쓴 글입니다.
> 제목 : Re : Re : 종목검색을 하고 싶은데요
> 안녕하세요
작성해주신 식으로 검색해봤는데
삼화전자가 검색되어야 하지만 종목이 하나도 안나옵니다
무엇이 잘못되었을까요??
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 종목검색을 하고 싶은데요
>
안녕하세요
예스스탁입니다.
하한가 계산을 위해 1번 사용자함수를 먼저 만드신 후
2번 종목검색식 작성해서 검색하시기 바랍니다.
1
사용자함수명 : Hoga
반환값형 : 숫자형
input : price(Numeric);
if CodeCategory == 1 Then
{
if date >= 20230125 Then
{
if Price < 2000 Then
Hoga = 1;
if 2000 <= Price and Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 20000 Then
Hoga = 10;
if 20000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 200000 Then
Hoga = 100;
if 200000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
Else
{
if sDate >= 20101004 Then
{
if Price < 1000 Then
Hoga = 1;
if 1000 <= Price and Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 100000 Then
Hoga = 100;
if 100000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
Else
{
if Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 100000 Then
Hoga = 100;
if 100000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
}
}
if CodeCategory == 2 Then
{
if date >= 20230125 Then
{
if Price < 2000 Then
Hoga = 1;
if 2000 <= Price and Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 20000 Then
Hoga = 10;
if 20000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 200000 Then
Hoga = 100;
if 200000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
Else
{
if sDate >= 20101004 Then
{
if Price < 1000 Then
Hoga = 1;
if 1000 <= Price and Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price Then
Hoga = 100;
}
Else
{
if sDate >= 20030721 Then
{
if Price < 5000 Then
Hoga = 5;
if 5000 <= Price and Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price Then
Hoga = 100;
}
Else
{
if Price < 10000 Then
Hoga = 10;
if 10000 <= Price and Price < 50000 Then
Hoga = 50;
if 50000 <= Price and Price < 100000 Then
Hoga = 100;
if 100000 <= Price and Price < 500000 Then
Hoga = 500;
if 500000 <= Price Then
Hoga = 1000;
}
}
}
}
2 종목검색
속성에서 검색에 필요한 최소기간에 넉넉히 310봉 이상 지정하고 검색하시기 바랍니다.
input : per(300);
var : LimitValue(0),vv(0),lv(0),DownLimit(0),v1(0),v2(0);
var : hh(0),hi(0),ll(0),cnt(0);
var : DNlimit(0),Hoga(0),하한가(0);
if date < 20050328 && CodeCategory() == 2 then
LimitValue = (BP*0.12);
Else if date >= 20050328 and date < 20150615 Then
LimitValue = (BP*0.15);
Else
LimitValue = (BP*0.30);
v1 = Hoga(BP);
vv = Floor(LimitValue/v1)*v1;
lv = BP-vv;
v2 = Hoga(lv);
DownLimit = Floor(lv/v2)*v2;
hh = highest(H,300);
hi = NthHighestBar(1,H,300);
ll = lowest(L,300);
Condition1 = False;
for cnt = max(0,hi-3) to hi
{
if DownLimit[cnt] <= 하한가[cnt] Then
Condition1 = true;
}
if var1 >= Var2*(1+per/100) and
Condition1 == true Then
Find(1);
즐거운 하루되세요
> 하루4 님이 쓴 글입니다.
> 제목 : 종목검색을 하고 싶은데요
> 최근 300일 이내에서 최저점보다 최고점이 300%이상인 종목중
최고점에서 3일이내 하한가가 있는 종목을 검색하고 싶습니다
감사합니다