커뮤니티
수식 질문드립니다.
2019-07-08 08:30:19
346
글번호 130107
수식 여쭤보는게 2가지 입니다~
1번수식 질문
===============================================================
안녕하세요~
일반 주식 1분봉 차트 에서 매매 하려고 합니다.
금액은 변수로 설정하고 싶어요.
매수 기준은 일봉상
3일전 음봉
2일전 음봉
1일전 양봉 이고
오늘 시가가 +10% ~ -10% 범위에서 시작할때
시가에 매수
1차 매도는 오늘 14시50분 매수물량의 20%
2차 매도는 내일 14시50분 남은 물량의 25%
3차 매도는 이틀후 14시50분 남은 물량의 35%
4차 매도는 삼일후 14시50분 남은 물량의 50%
5차 매도는 사일후 14시50분 남은 물량 전부
매수후 +20% 달성시 현재 남은 전체물량의 30% 매도
매수후 +30% 달성시 현재 남은 전체물량의 50% 매도
매수후 +40% 달성시 남은 물량 전부 매도
손절은 매수후 -20% 남은 물량의 50%
-30% 전부 매도
감사합니다.
===========================================================================
====================================================================
2번수식 질문
안녕하세요?
매매는 개별주식 1분봉에 적용할려구 합니다.
매수시간은 14시15분 입니다.
매수조건은 14시15분에
현재 일봉상 양봉 이지만 상한가가 아니면서
오늘 고가가 전일 종가대비 20%를 넘은적이 없으면서
현재 일봉상 오늘 거래량이 50000주 이상
일봉상 볼린져 밴드 20 ,2 고가가 상한선 이상
60분봉 볼린져 밴드 20 ,2 고가가 상한선 이상
일때 매수
매도는
매수일+1일 9시30분 전체물량의 20%
매수일+2일 9시30분 남은물량의 25%
매수일+3일 9시30분 남은물량의 33%
매수일+4일 9시30분 남은물량의 50%
매수일+5일 9시30분 전부 매도
매수후 +10% 달성시 남은 물량의 30% 매도
매수후 +20% 달성시 남은 물량의 50% 매도
매수후 +30% 달성시 남은 물량전부 매도
매수후 -10% 달성시 남은 물량의 30% 손절
매수후 -20% 달성시 남은 물량의 50% 손절
매수후 -30% 달성시 전부 손절
감사합니다.
답변 3
예스스탁 예스스탁 답변
2019-07-08 10:55:16
안녕하세요
예스스탁입니다.
1
input : 금액(10000000);
var : count(0);
if MarketPosition == 0 and
NextBarSdate != sdate and
DayClose(0) > DayClose(0) and
DayClose(1) > DayClose(1) and
DayClose(2) > DayClose(2) and
NextBarOpen <= DayClose(1)*1.10 and
NextBarOpen >= DayClose(1)*0.90 Then
buy("b",AtMarket,def,Floor(금액/NextBarOpen));
if MarketPosition == 1 Then
{
if stime >= 145000 and stime[1] < 145000 Then
{
count = count+1;
if count == 1 Then
ExitLong("bx1",OnClose,def,"",floor(CurrentContracts*0.20),1);
if count == 2 Then
ExitLong("bx2",OnClose,def,"",floor(CurrentContracts*0.25),1);
if count == 3 Then
ExitLong("bx3",OnClose,def,"",floor(CurrentContracts*0.35),1);
if count == 4 Then
ExitLong("bx4",OnClose,def,"",floor(CurrentContracts*0.50),1);
if count == 5 Then
ExitLong("bx5");
}
ExitLong("bp1",atlimit,EntryPrice*1.20,"",Floor(CurrentContracts*0.30),1);
ExitLong("bp2",atlimit,EntryPrice*1.30,"",Floor(CurrentContracts*0.50),1);
ExitLong("bp3",atlimit,EntryPrice*1.40);
ExitLong("bl1",AtStop,EntryPrice*0.80,"",Floor(CurrentContracts*0.50),1);
ExitLong("bl2",AtStop,EntryPrice*0.70);
}
Else
count = 0;
2
input : 금액(10000000);
input : 타주기분1(60),P1(20),Dv1(2);
var : S1(0),D1(0),TM(0),TF1(0),cnt(0);
var : SumSqrt1(0),Stdv1(0),sum1(0),BBmd1(0),Bbup1(0),BBdn1(0);
var : SumSqrt2(0),Stdv2(0),sum2(0),BBmd2(0),Bbup2(0),BBdn2(0);
Array : C1[100](0),C2[100](0);
var : 상한가(0), UpLimit(0),count(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(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 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;
}
}
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TM%타주기분1;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF1 < TF1[1]) Then
{
for cnt = 1 to 99
{
C1[cnt] = C1[cnt-1][1];
}
}
C1[0] = C;
if C1[P1] > 0 then
{
sum1 = 0;
for cnt = 0 to P1-1
{
sum1 = sum1 + C1[cnt];
}
BBmd1 = sum1/P1;
SumSqrt1 = 0;
For cnt = 0 To P1 - 1
{
SumSqrt1 = SumSqrt1 + (C1[cnt] - BBmd1)^2;
}
Stdv1 = SquareRoot(SumSqrt1/P1);
BBup1 = BBmd1 + (Dv1 * Stdv1);
BBdn1 = BBmd1 - (Dv1 * Stdv1);
}
if DayClose(P1) > 0 then
{
sum2 = 0;
for cnt = 0 to P1-1
{
sum2 = sum2 + dayclose(cnt);
}
BBmd2 = sum2/P1;
SumSqrt2 = 0;
For cnt = 0 To P1 - 1
{
SumSqrt2 = SumSqrt2 + (DayClose(cnt) - BBmd2)^2;
}
Stdv2 = SquareRoot(SumSqrt2/P1);
BBup2 = BBmd2 + (Dv1 * Stdv2);
BBdn2 = BBmd2 - (Dv1 * Stdv2);
}
if MarketPosition == 0 and
stime >= 141500 and stime[1] < 141500 and
bbup1 > 0 and bbup2 > 0 and
c > dayopen and
DayHigh < 상한가 and
DayHigh < DayClose(1)*1.20 and
DayVolume(0) < 50000 and
DayHigh > bbup1 and
DayHigh > bbup2 Then
buy("b",Onclose,def,Floor(금액/c));
}
if MarketPosition == 1 Then
{
if stime >= 93000 and stime[1] < 93000 Then
{
count = count+1;
if count == 1 Then
ExitLong("bx1",OnClose,def,"",floor(CurrentContracts*0.20),1);
if count == 2 Then
ExitLong("bx2",OnClose,def,"",floor(CurrentContracts*0.25),1);
if count == 3 Then
ExitLong("bx3",OnClose,def,"",floor(CurrentContracts*0.35),1);
if count == 4 Then
ExitLong("bx4",OnClose,def,"",floor(CurrentContracts*0.50),1);
if count == 5 Then
ExitLong("bx5");
}
ExitLong("bp1",atlimit,EntryPrice*1.10,"",Floor(CurrentContracts*0.30),1);
ExitLong("bp2",atlimit,EntryPrice*1.20,"",Floor(CurrentContracts*0.50),1);
ExitLong("bp3",atlimit,EntryPrice*1.30);
ExitLong("bl1",AtStop,EntryPrice*0.90,"",Floor(CurrentContracts*0.30),1);
ExitLong("bl2",AtStop,EntryPrice*0.80,"",Floor(CurrentContracts*0.50),1);
ExitLong("bl3",AtStop,EntryPrice*0.70);
}
Else
count = 0;
즐거운 하루되세요
> 부자청년28 님이 쓴 글입니다.
> 제목 : 수식 질문드립니다.
>
수식 여쭤보는게 2가지 입니다~
1번수식 질문
===============================================================
안녕하세요~
일반 주식 1분봉 차트 에서 매매 하려고 합니다.
금액은 변수로 설정하고 싶어요.
매수 기준은 일봉상
3일전 음봉
2일전 음봉
1일전 양봉 이고
오늘 시가가 +10% ~ -10% 범위에서 시작할때
시가에 매수
1차 매도는 오늘 14시50분 매수물량의 20%
2차 매도는 내일 14시50분 남은 물량의 25%
3차 매도는 이틀후 14시50분 남은 물량의 35%
4차 매도는 삼일후 14시50분 남은 물량의 50%
5차 매도는 사일후 14시50분 남은 물량 전부
매수후 +20% 달성시 현재 남은 전체물량의 30% 매도
매수후 +30% 달성시 현재 남은 전체물량의 50% 매도
매수후 +40% 달성시 남은 물량 전부 매도
손절은 매수후 -20% 남은 물량의 50%
-30% 전부 매도
감사합니다.
===========================================================================
====================================================================
2번수식 질문
안녕하세요?
매매는 개별주식 1분봉에 적용할려구 합니다.
매수시간은 14시15분 입니다.
매수조건은 14시15분에
현재 일봉상 양봉 이지만 상한가가 아니면서
오늘 고가가 전일 종가대비 20%를 넘은적이 없으면서
현재 일봉상 오늘 거래량이 50000주 이상
일봉상 볼린져 밴드 20 ,2 고가가 상한선 이상
60분봉 볼린져 밴드 20 ,2 고가가 상한선 이상
일때 매수
매도는
매수일+1일 9시30분 전체물량의 20%
매수일+2일 9시30분 남은물량의 25%
매수일+3일 9시30분 남은물량의 33%
매수일+4일 9시30분 남은물량의 50%
매수일+5일 9시30분 전부 매도
매수후 +10% 달성시 남은 물량의 30% 매도
매수후 +20% 달성시 남은 물량의 50% 매도
매수후 +30% 달성시 남은 물량전부 매도
매수후 -10% 달성시 남은 물량의 30% 손절
매수후 -20% 달성시 남은 물량의 50% 손절
매수후 -30% 달성시 전부 손절
감사합니다.
부자청년28
2019-07-08 10:55:08
맞는건지요? 감사합니다~
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식 질문드립니다.
> 안녕하세요
예스스탁입니다.
1
input : 금액(10000000);
var : count(0);
if MarketPosition == 0 and
NextBarSdate != sdate and
DayClose(0) > DayClose(0) and
DayClose(1) > DayClose(1) and
DayClose(2) > DayClose(2) and
NextBarOpen <= DayClose(1)*1.10 and
NextBarOpen >= DayClose(1)*0.90 Then
buy("b",AtMarket,def,Floor(금액/NextBarOpen));
if MarketPosition == 1 Then
{
if stime >= 145000 and stime[1] < 145000 Then
{
count = count+1;
if count == 1 Then
ExitLong("bx1",OnClose,def,"",floor(CurrentContracts*0.20),1);
if count == 2 Then
ExitLong("bx2",OnClose,def,"",floor(CurrentContracts*0.25),1);
if count == 3 Then
ExitLong("bx3",OnClose,def,"",floor(CurrentContracts*0.35),1);
if count == 4 Then
ExitLong("bx4",OnClose,def,"",floor(CurrentContracts*0.50),1);
if count == 5 Then
ExitLong("bx5");
}
ExitLong("bp1",atlimit,EntryPrice*1.20,"",Floor(CurrentContracts*0.30),1);
ExitLong("bp2",atlimit,EntryPrice*1.30,"",Floor(CurrentContracts*0.50),1);
ExitLong("bp3",atlimit,EntryPrice*1.40);
ExitLong("bl1",AtStop,EntryPrice*0.80,"",Floor(CurrentContracts*0.50),1);
ExitLong("bl2",AtStop,EntryPrice*0.70);
}
2
input : 금액(10000000);
input : 타주기분1(60),P1(20),Dv1(2);
var : S1(0),D1(0),TM(0),TF1(0),cnt(0);
var : SumSqrt1(0),Stdv1(0),sum1(0),BBmd1(0),Bbup1(0),BBdn1(0);
var : SumSqrt2(0),Stdv2(0),sum2(0),BBmd2(0),Bbup2(0),BBdn2(0);
Array : C1[100](0),C2[100](0);
var : 상한가(0), UpLimit(0),count(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(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 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;
}
}
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TM%타주기분1;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF1 < TF1[1]) Then
{
for cnt = 1 to 99
{
C1[cnt] = C1[cnt-1][1];
}
}
C1[0] = C;
if C1[P1] > 0 then
{
sum1 = 0;
for cnt = 0 to P1-1
{
sum1 = sum1 + C1[cnt];
}
BBmd1 = sum1/P1;
SumSqrt1 = 0;
For cnt = 0 To P1 - 1
{
SumSqrt1 = SumSqrt1 + (C1[cnt] - BBmd1)^2;
}
Stdv1 = SquareRoot(SumSqrt1/P1);
BBup1 = BBmd1 + (Dv1 * Stdv1);
BBdn1 = BBmd1 - (Dv1 * Stdv1);
}
if DayClose(P1) > 0 then
{
sum2 = 0;
for cnt = 0 to P1-1
{
sum2 = sum2 + dayclose(cnt);
}
BBmd2 = sum2/P1;
SumSqrt2 = 0;
For cnt = 0 To P1 - 1
{
SumSqrt2 = SumSqrt2 + (DayClose(cnt) - BBmd2)^2;
}
Stdv2 = SquareRoot(SumSqrt2/P1);
BBup2 = BBmd2 + (Dv1 * Stdv2);
BBdn2 = BBmd2 - (Dv1 * Stdv2);
}
if MarketPosition == 0 and
stime >= 141500 and stime[1] < 141500 and
bbup1 > 0 and bbup2 > 0 and
c > dayopen and
DayHigh < 상한가 and
DayHigh < DayClose(1)*1.20 and
DayVolume(0) < 50000 and
DayHigh > bbup1 and
DayHigh > bbup2 Then
buy("b",Onclose,def,Floor(금액/c));
}
if MarketPosition == 1 Then
{
if stime >= 93000 and stime[1] < 93000 Then
{
count = count+1;
if count == 1 Then
ExitLong("bx1",OnClose,def,"",floor(CurrentContracts*0.20),1);
if count == 2 Then
ExitLong("bx2",OnClose,def,"",floor(CurrentContracts*0.25),1);
if count == 3 Then
ExitLong("bx3",OnClose,def,"",floor(CurrentContracts*0.35),1);
if count == 4 Then
ExitLong("bx4",OnClose,def,"",floor(CurrentContracts*0.50),1);
if count == 5 Then
ExitLong("bx5");
}
ExitLong("bp1",atlimit,EntryPrice*1.10,"",Floor(CurrentContracts*0.30),1);
ExitLong("bp2",atlimit,EntryPrice*1.20,"",Floor(CurrentContracts*0.50),1);
ExitLong("bp3",atlimit,EntryPrice*1.30);
ExitLong("bl1",AtStop,EntryPrice*0.90,"",Floor(CurrentContracts*0.30),1);
ExitLong("bl2",AtStop,EntryPrice*0.80,"",Floor(CurrentContracts*0.50),1);
ExitLong("bl3",AtStop,EntryPrice*0.70);
}
즐거운 하루되세요
> 부자청년28 님이 쓴 글입니다.
> 제목 : 수식 질문드립니다.
>
수식 여쭤보는게 2가지 입니다~
1번수식 질문
===============================================================
안녕하세요~
일반 주식 1분봉 차트 에서 매매 하려고 합니다.
금액은 변수로 설정하고 싶어요.
매수 기준은 일봉상
3일전 음봉
2일전 음봉
1일전 양봉 이고
오늘 시가가 +10% ~ -10% 범위에서 시작할때
시가에 매수
1차 매도는 오늘 14시50분 매수물량의 20%
2차 매도는 내일 14시50분 남은 물량의 25%
3차 매도는 이틀후 14시50분 남은 물량의 35%
4차 매도는 삼일후 14시50분 남은 물량의 50%
5차 매도는 사일후 14시50분 남은 물량 전부
매수후 +20% 달성시 현재 남은 전체물량의 30% 매도
매수후 +30% 달성시 현재 남은 전체물량의 50% 매도
매수후 +40% 달성시 남은 물량 전부 매도
손절은 매수후 -20% 남은 물량의 50%
-30% 전부 매도
감사합니다.
===========================================================================
====================================================================
2번수식 질문
안녕하세요?
매매는 개별주식 1분봉에 적용할려구 합니다.
매수시간은 14시15분 입니다.
매수조건은 14시15분에
현재 일봉상 양봉 이지만 상한가가 아니면서
오늘 고가가 전일 종가대비 20%를 넘은적이 없으면서
현재 일봉상 오늘 거래량이 50000주 이상
일봉상 볼린져 밴드 20 ,2 고가가 상한선 이상
60분봉 볼린져 밴드 20 ,2 고가가 상한선 이상
일때 매수
매도는
매수일+1일 9시30분 전체물량의 20%
매수일+2일 9시30분 남은물량의 25%
매수일+3일 9시30분 남은물량의 33%
매수일+4일 9시30분 남은물량의 50%
매수일+5일 9시30분 전부 매도
매수후 +10% 달성시 남은 물량의 30% 매도
매수후 +20% 달성시 남은 물량의 50% 매도
매수후 +30% 달성시 남은 물량전부 매도
매수후 -10% 달성시 남은 물량의 30% 손절
매수후 -20% 달성시 남은 물량의 50% 손절
매수후 -30% 달성시 전부 손절
감사합니다.
예스스탁 예스스탁 답변
2019-07-08 10:56:49
안녕하세요
예스스탁입니다.
그대로 사용하시면 됩니다.
상한가, 일봉 볼밴, 타주기 60 분봉 볼밴 계산식이 있어
수식의 양이 많습니다.
즐거운 하루되세요
> 부자청년28 님이 쓴 글입니다.
> 제목 : 2번 수식이 뭔가 혼합된거 같은데요~
>
맞는건지요? 감사합니다~
> 예스스탁 님이 쓴 글입니다.
> 제목 : Re : 수식 질문드립니다.
> 안녕하세요
예스스탁입니다.
1
input : 금액(10000000);
var : count(0);
if MarketPosition == 0 and
NextBarSdate != sdate and
DayClose(0) > DayClose(0) and
DayClose(1) > DayClose(1) and
DayClose(2) > DayClose(2) and
NextBarOpen <= DayClose(1)*1.10 and
NextBarOpen >= DayClose(1)*0.90 Then
buy("b",AtMarket,def,Floor(금액/NextBarOpen));
if MarketPosition == 1 Then
{
if stime >= 145000 and stime[1] < 145000 Then
{
count = count+1;
if count == 1 Then
ExitLong("bx1",OnClose,def,"",floor(CurrentContracts*0.20),1);
if count == 2 Then
ExitLong("bx2",OnClose,def,"",floor(CurrentContracts*0.25),1);
if count == 3 Then
ExitLong("bx3",OnClose,def,"",floor(CurrentContracts*0.35),1);
if count == 4 Then
ExitLong("bx4",OnClose,def,"",floor(CurrentContracts*0.50),1);
if count == 5 Then
ExitLong("bx5");
}
ExitLong("bp1",atlimit,EntryPrice*1.20,"",Floor(CurrentContracts*0.30),1);
ExitLong("bp2",atlimit,EntryPrice*1.30,"",Floor(CurrentContracts*0.50),1);
ExitLong("bp3",atlimit,EntryPrice*1.40);
ExitLong("bl1",AtStop,EntryPrice*0.80,"",Floor(CurrentContracts*0.50),1);
ExitLong("bl2",AtStop,EntryPrice*0.70);
}
2
input : 금액(10000000);
input : 타주기분1(60),P1(20),Dv1(2);
var : S1(0),D1(0),TM(0),TF1(0),cnt(0);
var : SumSqrt1(0),Stdv1(0),sum1(0),BBmd1(0),Bbup1(0),BBdn1(0);
var : SumSqrt2(0),Stdv2(0),sum2(0),BBmd2(0),Bbup2(0),BBdn2(0);
Array : C1[100](0),C2[100](0);
var : 상한가(0), UpLimit(0),count(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(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 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;
}
}
if Bdate != Bdate[1] Then
{
S1 = TimeToMinutes(stime);
D1 = sdate;
}
if D1 > 0 then
{
if sdate == D1 Then
TM = TimeToMinutes(stime)-S1;
Else
TM = TimeToMinutes(stime)+1440-S1;
TF1 = TM%타주기분1;
if Bdate != Bdate[1] or (Bdate == Bdate[1] and TF1 < TF1[1]) Then
{
for cnt = 1 to 99
{
C1[cnt] = C1[cnt-1][1];
}
}
C1[0] = C;
if C1[P1] > 0 then
{
sum1 = 0;
for cnt = 0 to P1-1
{
sum1 = sum1 + C1[cnt];
}
BBmd1 = sum1/P1;
SumSqrt1 = 0;
For cnt = 0 To P1 - 1
{
SumSqrt1 = SumSqrt1 + (C1[cnt] - BBmd1)^2;
}
Stdv1 = SquareRoot(SumSqrt1/P1);
BBup1 = BBmd1 + (Dv1 * Stdv1);
BBdn1 = BBmd1 - (Dv1 * Stdv1);
}
if DayClose(P1) > 0 then
{
sum2 = 0;
for cnt = 0 to P1-1
{
sum2 = sum2 + dayclose(cnt);
}
BBmd2 = sum2/P1;
SumSqrt2 = 0;
For cnt = 0 To P1 - 1
{
SumSqrt2 = SumSqrt2 + (DayClose(cnt) - BBmd2)^2;
}
Stdv2 = SquareRoot(SumSqrt2/P1);
BBup2 = BBmd2 + (Dv1 * Stdv2);
BBdn2 = BBmd2 - (Dv1 * Stdv2);
}
if MarketPosition == 0 and
stime >= 141500 and stime[1] < 141500 and
bbup1 > 0 and bbup2 > 0 and
c > dayopen and
DayHigh < 상한가 and
DayHigh < DayClose(1)*1.20 and
DayVolume(0) < 50000 and
DayHigh > bbup1 and
DayHigh > bbup2 Then
buy("b",Onclose,def,Floor(금액/c));
}
if MarketPosition == 1 Then
{
if stime >= 93000 and stime[1] < 93000 Then
{
count = count+1;
if count == 1 Then
ExitLong("bx1",OnClose,def,"",floor(CurrentContracts*0.20),1);
if count == 2 Then
ExitLong("bx2",OnClose,def,"",floor(CurrentContracts*0.25),1);
if count == 3 Then
ExitLong("bx3",OnClose,def,"",floor(CurrentContracts*0.35),1);
if count == 4 Then
ExitLong("bx4",OnClose,def,"",floor(CurrentContracts*0.50),1);
if count == 5 Then
ExitLong("bx5");
}
ExitLong("bp1",atlimit,EntryPrice*1.10,"",Floor(CurrentContracts*0.30),1);
ExitLong("bp2",atlimit,EntryPrice*1.20,"",Floor(CurrentContracts*0.50),1);
ExitLong("bp3",atlimit,EntryPrice*1.30);
ExitLong("bl1",AtStop,EntryPrice*0.90,"",Floor(CurrentContracts*0.30),1);
ExitLong("bl2",AtStop,EntryPrice*0.80,"",Floor(CurrentContracts*0.50),1);
ExitLong("bl3",AtStop,EntryPrice*0.70);
}
즐거운 하루되세요
> 부자청년28 님이 쓴 글입니다.
> 제목 : 수식 질문드립니다.
>
수식 여쭤보는게 2가지 입니다~
1번수식 질문
===============================================================
안녕하세요~
일반 주식 1분봉 차트 에서 매매 하려고 합니다.
금액은 변수로 설정하고 싶어요.
매수 기준은 일봉상
3일전 음봉
2일전 음봉
1일전 양봉 이고
오늘 시가가 +10% ~ -10% 범위에서 시작할때
시가에 매수
1차 매도는 오늘 14시50분 매수물량의 20%
2차 매도는 내일 14시50분 남은 물량의 25%
3차 매도는 이틀후 14시50분 남은 물량의 35%
4차 매도는 삼일후 14시50분 남은 물량의 50%
5차 매도는 사일후 14시50분 남은 물량 전부
매수후 +20% 달성시 현재 남은 전체물량의 30% 매도
매수후 +30% 달성시 현재 남은 전체물량의 50% 매도
매수후 +40% 달성시 남은 물량 전부 매도
손절은 매수후 -20% 남은 물량의 50%
-30% 전부 매도
감사합니다.
===========================================================================
====================================================================
2번수식 질문
안녕하세요?
매매는 개별주식 1분봉에 적용할려구 합니다.
매수시간은 14시15분 입니다.
매수조건은 14시15분에
현재 일봉상 양봉 이지만 상한가가 아니면서
오늘 고가가 전일 종가대비 20%를 넘은적이 없으면서
현재 일봉상 오늘 거래량이 50000주 이상
일봉상 볼린져 밴드 20 ,2 고가가 상한선 이상
60분봉 볼린져 밴드 20 ,2 고가가 상한선 이상
일때 매수
매도는
매수일+1일 9시30분 전체물량의 20%
매수일+2일 9시30분 남은물량의 25%
매수일+3일 9시30분 남은물량의 33%
매수일+4일 9시30분 남은물량의 50%
매수일+5일 9시30분 전부 매도
매수후 +10% 달성시 남은 물량의 30% 매도
매수후 +20% 달성시 남은 물량의 50% 매도
매수후 +30% 달성시 남은 물량전부 매도
매수후 -10% 달성시 남은 물량의 30% 손절
매수후 -20% 달성시 남은 물량의 50% 손절
매수후 -30% 달성시 전부 손절
감사합니다.