예스스탁
예스스탁 답변
2021-02-26 13:25:49
안녕하세요
예스스탁입니다.
input : 금액(10000000),Per1(-2),Per2(-4);
input : 익절1(5),익절2(7),익절3(9),손절1(-10),손절2(-15),수익률(5),감소율(-2);
input : 분1(10),분2(15),분3(20),분4(25),분5(30);
var : 상한가(0), UpLimit(0),TM(0),BT(0),BE(0),BH(0),BL(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;
}
}
TM = TimeToMinutes(sTime);
if DayHigh >= 상한가 and NextBarSdate != sDate Then
{
Buy("b1",AtMarket,DEF,Floor((금액*0.3)/NextBarOpen));
Buy("b2",AtLimit,NextBarOpen*(1+Per1/100),Floor((금액*0.3)/min(DayClose(1)*0.98,NextBarOpen)));
Buy("b3",AtLimit,NextBarOpen*(1+Per2/100),Floor((금액*0.4)/min(DayClose(1)*0.96,NextBarOpen)));
}
if MarketPosition == 1 and sTime < 130000 Then
{
if DayLow > DayOpen*(1+per1/100) Then
Buy("b2.",AtLimit,NextBarOpen*(1+Per1/100),Floor((금액*0.3)/min(DayClose(1)*0.98,NextBarOpen)));
if DayLow > DayOpen*(1+per2/100) Then
Buy("b3.",AtLimit,NextBarOpen*(1+Per2/100),Floor((금액*0.3)/min(DayClose(1)*0.98,NextBarOpen)));
}
if MarketPosition == 1 Then
{
if CurrentContracts > CurrentContracts[1] Then
{
BT = TM;
BE = LatestEntryPrice(0);
BH = BE;
BL = BE;
}
if H > BH Then
BH = H;
if L < BL Then
BL = H;
if BL > BE*(1+손절1/100) Then
ExitLong("bl1",AtStop,BE*(1+손절1/100),"",Floor(CurrentContracts*0.5),1);
if BL > BE*(1+손절2/100) Then
ExitLong("bl2",AtStop,BE*(1+손절2/100));
if BH < BE*(1+익절1/100) Then
ExitLong("bp1",AtLimit,BE*(1+익절1/100),"",Floor(CurrentContracts*0.5),1);
if BH < BE*(1+익절2/100)Then
ExitLong("bp2",AtLimit,BE*(1+익절2/100));
if TM >= BT+분1 and TM[1] < BT+분1 Then
ExitLong("bt1",OnClose,DEF,"",Floor(CurrentContracts*0.3),1);
if TM >= BT+분2 and TM[1] < BT+분2 Then
ExitLong("bt2",OnClose,DEF,"",Floor(CurrentContracts*0.5),1);
if TM >= BT+분3 and TM[1] < BT+분3 Then
ExitLong("bt3",OnClose,DEF,"",Floor(CurrentContracts*0.5),1);
if TM >= BT+분4 and TM[1] < BT+분4 Then
ExitLong("bt4",OnClose,DEF,"",Floor(CurrentContracts*0.5),1);
if TM >= BT+분5 and TM[1] < BT+분5 Then
ExitLong("bt5");
if BH >= BE+(1+수익률) Then
ExitLong("btr",AtStop,BH*(1+감소율/100));
}
SetStopEndofday(151000);
즐거운 하루되세요
> 부자청년28 님이 쓴 글입니다.
> 제목 : 시스템 식 질문 드립니다.
> 안녕하세요?
시스템식 여쭤 봅니다~
1분봉에서 매매 예정입니다.
일봉상 전일 상한가
매수는
1차매수 오늘 시초가 에 30%
2차매수는 시초가 -2% 에 30%
3차매수는 시초가 -4% 에 40%
매수가 일어나는 시간은 오전 9시부터 오후1시 사이
매도는
매수시점부터 10분후 현재남은 물량의 30% 매도
15분후 현재남은 물량의 50% 매도
20분후 현재남은 물량의 50% 매도
25분후 현재남은 물량의 50% 매도
30분후 현재남은 물량 전부 매도
매수후 5% 상승시 현재물량의 50% 매도
매수후 10% 상승시 남은 전체 매도
매수후 5% 상승했다가 2% 까지 떨어지면 전체매도
손절은!
매수후 -10% 남은 물량의 50% 매도
매수후 -15% 전체 손절
청산은!
당일 15시10분 전부 매도
이상입니다.
감사합니다~