예스스탁
예스스탁 답변
2021-04-14 16:38:26
안녕하세요
예스스탁입니다.
input : Per1(-10),Per2(-15),Per3(-20);
input : 금액(10000000),비중1(20),비중2(30),비중3(50);
input : 익절(10),횡보(5),횡보기간(120);
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
var : DH(0),Trade(False),cnt(0),HH(0),LL(0),T1(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
{
Trade = False;
if DayClose(1) >= 상한가[1] Then
trade = true;
DH = DayHigh(1);
For cnt = 1 to 30
{
if DayHigh(cnt) > DH Then
DH = DayHigh(cnt);
}
}
if DayHigh > DH Then
Trade = true;
if sDate == 20210413 Then
MessageLog("%.f %.f %.f",DayLow,DayOpen*(1+Per3/100),Floor((금액*(비중3/100))/min(DayOpen*(1+Per3/100),NextBarOpen)));
if Trade == true and sTime < 120000 Then
{
if MarketPosition == 0 and DayLow > DayOpen*(1+Per1/100) Then
Buy("b1",AtLimit,DayOpen*(1+Per1/100),Floor((금액*(비중1/100))/min(DayOpen*(1+Per1/100),NextBarOpen)));
if MarketPosition >= 0 and DayLow > DayOpen*(1+Per2/100) Then
Buy("b2",AtLimit,DayOpen*(1+Per2/100),Floor((금액*(비중2/100))/min(DayOpen*(1+Per2/100),NextBarOpen)));
if MarketPosition >= 0 and DayLow > DayOpen*(1+Per3/100) Then
Buy("b3",AtLimit,DayOpen*(1+Per3/100),Floor((금액*(비중3/100))/min(DayOpen*(1+Per3/100),NextBarOpen)));
}
if MarketPosition == 1 Then
{
ExitLong("익절청산",AtLimit,AvgEntryPrice*(1+익절/100));
if CurrentContracts > CurrentContracts[1] Then
{
T1 = TimeToMinutes(sTime);
hh = H;
ll = l;
}
if h > hh Then
hh = h;
if l < ll Then
ll = l;
if TimeToMinutes(sTime) >= T1+횡보기간 and hh < LatestEntryPrice(0)*(1+횡보/100) and LL >= LatestEntryPrice(0)*(1-횡보/100) Then
ExitLong("횡보청산");
}
SetStopEndofday(151500);
즐거운 하루되세요
> 깜피 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 안녕하세요.
시스템을 작성에 많은 도움을 주셔서 시간을 많이 절약하고 있습니다.
노고에 항상 감사드립니다.
당일 거래용 시스템에 대해서 문의를 드리는데 수식 확인 부탁드립니다.
오늘도 좋은 하루 보내세요.
--------------------------------------------------------------------------
1. 종목 선정
- 전일 상한가 또는 당일 고가가 30일 이내 최고가인 종목
2. 매수기준
- 당일 시가 대비 -10%, -15%, -20%에 분할 매수(진입비중(금액), 진입가액(%) 조절 필요)
- 당일 12시 이전에 매수 가격에 와야 매수 가능
// 익절 후, 12시 이전에 다음 차수 거래가격에 도달하면 다음차수 거래 가능
(예, 시가 1000원, 1차-900원, 2차-850원, 3차-800원일 때, 12시 이전에 880원까지지 하락했다가 1100원까지 상승하면 익절 후 거래 종료, 단 익절 후 11:50분에 850원 이하로 하락하면 2차, 12시 이전에 800이하까지 하락하면 3차까지 매수 가능)
3. 매도 기준
- 매수평단 대비 10% 상승하면 익절
// 수익이 발생하면 거래 종료, 단 12시 이전에 다음 차수 거래가격에 도달하면 다음차수 거래 가능
- 매수 평단 대비 10%하락하면 손절
4. 기타
- 매수 후 2시간 동안 +-5% 변동없으면 청산
(예, 1차 매수후(1,2차 또는 1,2,3차 매수 후에도 동일) 2시간 동안 2차매수 안되고 +5% 상승하지도 않으면 청산.
- 당일 종가 청산