예스스탁
예스스탁 답변
2021-03-10 14:38:15
안녕하세요
예스스탁입니다.
1
input : 금액(3000000),진입횟수(2);
var : Price(0),Loss(0),entry(0),bh(0);
var : 상한가(0), UpLimit(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
{
Price = 0;
Loss = 0;
if O < C[1]*1.08 Then
{
Price = max(C,O);
Loss = min(C,O);
}
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition != MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition == 0 and entry < 진입횟수 and Price > 0 and CrossUp(C,price) and C > O Then
{
Buy("b",OnClose,DEF,Floor(금액/C));
}
if MarketPosition == 1 Then
{
bh = Highest(H,BarsSinceEntry);
if bh < EntryPrice*1.10 and CrossDown(C,Loss[BarsSinceEntry]) Then
ExitLong("bl1");
if bh >= EntryPrice*1.10 and CrossDown(C,price[BarsSinceEntry]) Then
ExitLong("bl2");
ExitLong("Bp1",AtLimit,EntryPrice*1.15,"",Floor(MaxContracts*0.5),1);
ExitLong("Bp2",AtLimit,상한가);
}
SetStopEndofday(151500);
2
input : 금액(3000000),진입횟수(2);
var : Price(0),Loss(0),entry(0),bh(0);
if Bdate != Bdate[1] Then
{
Price = 0;
Loss = 0;
if O < C[1]*1.08 Then
{
Price = max(C,O);
Loss = min(C,O);
}
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition != MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if MarketPosition == 0 and entry < 진입횟수 and Price > 0 and CrossUp(C,price) and C > O Then
{
Buy("b",OnClose,DEF,Floor(금액/C));
}
if MarketPosition == 1 Then
{
bh = Highest(H,BarsSinceEntry);
if bh < EntryPrice*1.10 and CrossDown(C,Loss[BarsSinceEntry]) Then
ExitLong("bl1");
if bh >= EntryPrice*1.10 and CrossDown(C,price[BarsSinceEntry]) Then
ExitLong("bl2");
}
즐거운 하루되세요
> 종호 님이 쓴 글입니다.
> 제목 : 문의드립니다.
> 주식 시스템 입니다.
3 분봉에서
매수준비 :
전날 일봉의 종가 대비 시가가 8% 이하로 상승하거나 하락 음봉일 때
매순 준비를 합니다.
즉 9시 시가가 8% 이상일 때는 매수를 안합니다.
매수:
1번 : 3분봉에서 그날 9시 최초봉이 양봉이면
이 때의 최초 3분봉의 양봉 종가를 매수 기준가 A
최초 3분봉의 양봉 시가를 매수 손절가 B 로 정하고
매수 기준가 A를 다른 3분봉이 양봉으로 상방 돌파시 300만원 매수합니다..
손절은 이 매수 손절가 B 를 음봉 종가가 하방으로 돌파시 손절합니다.
재매수 : 손절후 하방으로 하락했던 주가가 다시 상승해서 위의
매수기준가 A 를 상방 돌파시 300만원 재매수 합니다.
재매수 횟수는 그날 1회에 한하여 하며 다시 손절 후에는
다시 2차 재매수는 안합니다.
2번 : 3분봉에서 그날 9시 최초봉이 음봉이면
이 때의 최초 3분봉의 음봉 시가를 매수 기준가 A
최초 3분봉의 음봉 종가를 매수 손절가 B 로 정하고
매수 기준가 A를 다른 3분봉이 양봉으로 상방 돌파시 300만원 매수합니다..
손절은 이 매수 손절가 B 를 음봉 종가가 하방으로 돌파시 손절합니다.
재매수 : 손절후 하방으로 하락했던 주가가 다시 상승해서 위의
매수기준가 A 를 상방 돌파시 300만원 재매수 합니다.
재매수 횟수는 그날 1회에 한하여 하며 다시 손절 후에는
다시 2차 재매수는 안합니다.
수익청산 : 2가지 방법으로 적용 부탁합니다.
A 방법 :
매수후 10% 수익이 나면
매수 손절가 B = 매수 기준가 A 로 변경하고
매수후 15% 수익이 나면 50 %를 팔고 상한가에 가면 나머지 50%
를 다 팝니다. 안팔리면 그날 종가나 종가전에 다 청산합니다,
B 방법 :
매수후 10% 수익이 나면
매수 손절가 B = 매수 기준가 A 로 변경하고
그날 청산하지 않고 스윙으로 가져갑니다.