예스스탁
예스스탁 답변
2024-05-07 11:53:20
안녕하세요
예스스탁입니다.
input : P1(5),P2(60);
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
var : ii(0),hh(0),count(0),ll(0),lo(0);
var : dd(0),dm(0),cnt(0),sum1(0),sum2(0),mav1(0),mav2(0);
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 date >= 20230125 Then
{
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;
}
Else
{
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 date >= 20230125 Then
{
If BP >= 500000 Then
상한가 = up1;
Else If BP >= 200000 Then
상한가 = iff(up2>=500000, up1, up2);
Else If BP >= 50000 Then
상한가 = iff(up3>=200000, up2, up3);
Else If BP >= 20000 Then
상한가 = iff(up4>=50000, up3, up4);
Else If BP >= 5000 Then
상한가 = iff(up5>=20000, up4, up5);
Else If BP >= 2000 Then
상한가 = iff(up5>=5000, up5, up6);
Else
상한가 = iff(up6>=2000, up6, up7);
}
Else
{
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;
}
}
#일봉이평
sum1 = 0;
sum2 = 0;
For cnt = 0 to P2
{
if cnt < P1 Then
sum1 = sum1+DayClose(cnt);
if cnt < P2 Then
sum2 = sum2+DayClose(cnt);
}
mav1 = sum1/P1;
mav2 = sum2/P2;
#영업일 변경
if Bdate != Bdate[1] Then
{
#일수
dd = dd+1;
#당일거래대금 초기화
dm = 0;
}
#당일거래대금
dm = dm + Money;
#당일고가가 상한가이고 당일거래대금이 100억이상이면
if DayHigh(0) >= 상한가 and dm >= 10000000000 Then
{
#일수 저장
ii = dd;
#최고가 저장변수
hh = DayHigh(0);
#최저가 저장변수
ll = DayLow(0);
#카운트값 0
count = 0;
#조건만족 충족 true
Condition1 = true;
}
Else
{
#일봉상 상한가 발생후 당일저가가 일봉 60이평 아래이면 조건 해제
if Condition1 == true and DayLow < mav2 Then
Condition1 = False;
#조건 충족 후
if Condition1 == true Then
{
#일간고가 중 최고가 저장
if hh > 0 and DayHigh > hh Then
{
hh = DayHigh;
#최고가 갱신시마다 count는 0으로 초기화
count = 0;
#최고봉의 일수 저장
ii = dd;
}
#일간저가 중 최저가 저장
if DayLow < ll Then
ll = DayLow;
#고가로 5일선 상향돌파할때 Lo에 상한가이후 최저가 저장
if CrossUp(H,mav1) Then
Lo = ll;
#저가로 5일선 하향이탈
if CrossDown(L,mav1) Then
count = count+1;
#저가가 5일선 아래이고 60이평은 lo값-10%이하이고 최고가 이후 30일 아니애고 5일선 이탈이 2번이상이면
#현재가가 60선 이하이면 매
if l < mav1 and mav2 <= lo*0.90 and dd <= ii+30 and count >= 2 Then
Buy("b",AtLimit,mav2);
}
}
즐거운 하루되세요
> 깜피 님이 쓴 글입니다.
> 제목 : 문의드립니다。
>
안녕하세요.
지난번에 도움 주셨던 수식이 생각대로 되지 않아서 실제 생각했던 일봉 상 거래 방식을 좀 더 구체적으로 내용을 적었습니다.
다만 일봉으로는 수식을 만드는게 불가능하다는 생각이 들어서,
동 내용을 거래방식만 5분봉 거래로 변형해서 만들어 보고 싶은데 도움을 부탁드립니다.
항상 감사드립니다.
좋은 하루 보내세요.
*일봉상 상한가(거래대금 100억 이상) 발생한 종목이 바로 하락 또는 고가 갱신하다가
저가로 5일선 하락돌파->고가로 5일선 상승돌파->저가로 5일선 하락돌파 후 60일선 매수(최고가 봉 대비 30봉 이내에 매수)
** 5일선 상승돌파 및 하락돌파가 당일에 발생하는 것도 가능
** 매수전까지 한 번도 60일선에 닿지 않아야함
*5일선 상승 돌파 후 고가를 갱신하면 5일선 하락돌파-상승돌파-하락돌파를 다시 체크해야함(갱신된 최고가 봉 대비 30봉 이내에 매수)
* 5일선 상승 돌파 시 전저점을 체크하고, 체크한 전저점 대비 매수가(60일선)가 10%이상 낮아야함.