답변완료
수정부탁바랍니다
1. 장시작시 60선위에서 5선이 상승 변곡이 나오고, 캔들 몸통의 절반이 5선이 위에 있을때 매수인데..바로 매수가 들어가네요....
--> 장 시작하고 5선이 꺽였다가 다시 상승할때 몸통이 5선 위에 있을때 매수하고 싶습니다
2. 청산위치가 현재 5선이 20선 위에서 5파동에서 꺽이면 음봉이 나오면 청산인데..
-> 5선이 20선 위에서 5파동 이상인걸 만족하고, 캔들의 몸통의 절반이 20선 아래로 내려올때 청산하고 싶습니다.(모든조건을 동시에 만족이 아니라, 5파동 이상먼저나고, 5선이 꺽여있는 상황에서, 이후에 몸통이 20선 아래로 내려왔을때 청산입니다.
3. 청산 두번째 조건에서, 5선과 20선이 데드크로스가 나고, 5선이 변곡이 나올때 청산인데.
--> 5선과 20선이 데드가 나는 조건에서, 20선 아래서 5선이 상승했다가 다시 꺽일때 그리고 캔들 몸통의 절반이 5선 아래 있을때 청산하고 싶습니다 , 마찬가지로 동시에 만족이 아니라 데드가 나고 나서, 5선이 변곡이 나오고 나서 몸통이 내려왔을때 청산입니다
var : Period1(3),Period2(10),Period3(30),Period4(120),X5(0),X20(0),X60(0),XP(0),X(0),Y(0),Z(0),Q(0),Mav1(0), Mav2(0),Mav3(0),Mav4(0);
Input : Left(3),right(3);
var : B5(0),BP60(0),B20(0),B60(0),S5(0),S20(0),S60(0),SP60(0),Bcnt5(0),Bcnt20(0),Bcnt60(0),BcntP60(0), Scnt5(0), Scnt20(0), Scnt60(0),ScntP60(0),H1(0),H2(0),L1(0),L2(0);
InPUT : 진입시작시간(090000), 매매종료시간(153000);
Var26 = ema(Ema(Ema(c,period1),period1),period1); //ma(c,period1); //5선
Var27 = ema(Ema(Ema(c,period2),period2),period2); //20선
Var28 = ema(Ema(Ema(c,period3),period3),period3); //60선
Var29 = ema(Ema(Ema(c,period4),period4),period4); //240선
if CrossUp(Var26,Var27) Then
X5 = 1; //5-20 cross
if CrossDown(Var26,Var27) Then
X5 = -1;
if CrossUp(Var27,Var28) Then
X20 = 1; //20-60 cross
if CrossDown(Var27,Var28) Then
X20 = -1;
if CrossUp(Var28,Var29) Then
X60 = 1; //60-240 cross
if CrossDown(Var28,Var29) Then
X60 = -1;
if CrossUp(Var26,Var28) Then
XP = 1; //5-60 cross
if CrossDown(Var26,Var28) Then
XP = -1;
if Var26 > var26[1] Then
X = 1;
if Var26 < var26[1] Then
X = -1;
if Var27 > var27[1] Then // X5 : 5-20 Cross X : 5선
Y = 1; // X20 : 20-60 Cross Y : 20선
if Var27 < var27[1] Then // X60 : 60-240 cross Z : 60선
Y = -1; // XP : 5-60 cross
if Var28 > var28[1] Then
Z = 1;
if Var28 < var28[1] Then
Z = -1;
//////////////////////상방기준//////////////////
if XP == 1 and X == 1 Then //5-60 정배열 & 5상승
{
if X != X[1] Then //5선이 상승변곡 이면 B = 1
{
BP60 = 1;
} //5선이 상승변곡 & 20선 상승 & 5선 20선위 & 몸통이 5 BC 면 B =2
if BP60 == 1 and Y == 1 and Var26 > Var27 and C > O and (C+O)/2 >= var26 Then
{
BP60 = 2;
}
}
else
BP60 = 0;
//////////////////////하방기준//////////////////
if XP == -1 and X == -1 Then
{
if X!= X[1] Then
{
SP60 = 1;
}
if SP60 == 1 and Y == -1 and Var26 < Var27 and C < O and (C+O)/2 < var26 Then
{
SP60 = 2;
}
}
else
SP60 = 0;
//////////////////////////상방시그널/////////////////
if sTime >= 진입시작시간 and sTime <= 매매종료시간 and
XP == 1 Then
{
if XP != XP[1] Then
BcntP60 = 0;
if BP60 == 2 and BP60 != BP60[1] Then
{
BcntP60 = BcntP60+1;
if BcntP60 <= 1 Then
Buy("BP60");
}
}
////////////////////////하방 시그널//////////////////
if sTime >= 진입시작시간 and sTime <= 매매종료시간 and
XP == -1 Then
{
if XP != XP[1] Then
ScntP60 = 0;
if SP60 == 2 and SP60 != SP60[1] Then
{
ScntP60 = ScntP60+1;
if ScntP60 <= 1 Then
Sell("SP60");
}
}
if MarketPosition == 1 Then
{
if X5 == 1 and CountIf(X5 == -1,BarsSinceEntry) == 0 and
X == -1 and X != X[1] and CountIf(X == -1 and X != X[1],BarsSinceEntry) >= 2 then
ExitLong("콜청1",AtMarket);
}
if X5 == -1 and X == -1 and X != X[1] Then
ExitLong("콜정2",AtMarket);
if MarketPosition == -1 Then
{
if X5 == -1 and CountIf(X5 == 1,BarsSinceEntry) == 0 and
X == 1 and X != X[1] and CountIf(X == 1 and X != X[1],BarsSinceEntry) >= 2 Then
ExitShort("풋청1",AtMarket);
}
if X5 == 1 and X == 1 and X != X[1] Then
ExitShort("풋정2",AtMarket);
2021-05-04
1157
글번호 148678
시스템
답변완료
재문의드립니다.
안녕하세요.
아래수식을 돌리면 매매가 일어나지가 않습니다.
수정을 부탁드립니다.
그리고
if SPrice == 0 and
Bdate == bdate[2] and
C > mav and
C <= O and
C[1] > O[1] and C[2] > O[2] and
C <= DayClose(1)*1.15 Then
SPrice = C;
수식에서 SPrice = C; 가 아니고 종가가 아니고 시가이므로 SPrice = O;
인것 같습니다.
안녕하세요
예스스탁입니다.
input : 시작날짜(20210429),시작시간(110000);
input : 금액(3000000),진입횟수(3);
var : mav(0),SPrice(0),tcond(False);
var : 상한가(0), UpLimit(0),entry(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
if sDate == 시작날짜 and sTime >= 시작시간 Then
Tcond = true;
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;
}
}
mav = ma(C,33);
if Bdate != Bdate[1] Then
{
SPrice = 0;
entry = 0;
}
if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or
(MarketPosition == MarketPosition[1] and TotalTrades > TotalTrades[1]) Then
entry = entry+1;
if SPrice == 0 and
Bdate == bdate[2] and
C > mav and
C <= O and
C[1] > O[1] and C[2] > O[2] and
C <= DayClose(1)*1.15 Then
SPrice = C;
if MarketPosition == 0 and Tcond == true and SPrice > 0 and CrossUp(C,SPrice) and entry < 0 and 진입횟수 Then
Buy("b",OnClose,DEf,Floor(금액/C));
if MarketPosition == 1 Then
{
Sprice = 0;
if TimeToMinutes(sTime) >= TimeToMinutes(EntryTime(0))+60 Then
ExitLong("bx");
if CurrentContracts == MaxContracts Then
ExitLong("bp",AtLimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1);
Else
ExitLong("be",AtStop,EntryPrice);
ExitLong("bu",AtLimit,상한가);
}
SetStopLoss(3,PercentStop);
SetStopProfittarget(15,PercentStop);
SetStopEndofday(151500);
즐거운 하루되세요
> 종호 님이 쓴 글입니다.
> 제목 : 조건식 수정 문의합니다
> 아래에서 주문시 300만원 해당되게 매수되도록 수정하고요.
매수하고 나서 수익 청산이던지 본절,손절 어떤 청산이던지 매수 잔고가 0 이
되면 초기화하도록 부탁드립니다.
초기화 이후 조건이 만족하면 또 반복 메수되고 청산하도록 하고요.
1일에 최대 매수 횟수를 3회만 되도록 부탁드립니다.
안녕하세요
예스스탁입니다.
날짜시간을 지정해서 해당일시 이후에 신호가 발생하게 하는 방법뿐이 없습니다.
input : 시작날짜(20210429),시작시간(110000);
var : mav(0),SPrice(0),tcond(False);
var : 상한가(0), UpLimit(0);
var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0);
if sDate == 시작날짜 and sTime >= 시작시간 Then
Tcond = true;
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;
}
}
mav = ma(C,33);
if Bdate != Bdate[1] Then
SPrice = 0;
if SPrice == 0 and
Bdate == bdate[2] and
C > mav and
C <= O and
C[1] > O[1] and C[2] > O[2] and
C <= DayClose(1)*1.15 Then
SPrice = C;
if Tcond == true and SPrice > 0 and CrossUp(C,SPrice) Then
Buy();
if MarketPosition == 1 Then
{
if TimeToMinutes(sTime) >= TimeToMinutes(EntryTime(0))+60 Then
ExitLong("bx");
if CurrentContracts == MaxContracts Then
ExitLong("bp",AtLimit,EntryPrice*1.05,"",Floor(MaxContracts*0.5),1);
Else
ExitLong("be",AtStop,EntryPrice);
ExitLong("bu",AtLimit,상한가);
}
SetStopLoss(3,PercentStop);
SetStopProfittarget(15,PercentStop);
SetStopEndofday(151500);
즐거운 하루되세요
> 종호 님이 쓴 글입니다.
> 제목 : 문의합니다.
> 주식종목을 검토하다 장중에 좋은 주식이 나오면
장중 시간에 들어가서 시스템으로 매매하고 싶습니다.
그런데
예를 들어 11시에 시스템을 돌렸다면
11시 이전에 매수신호가 나온 것이 있을 수 있어서 피라미딩은 안한다는 전제하에
11시 이후에는 다시 진입을 할 수가 없다는 것입니다.
그래서 input 변수로 날자와 시간을 변수로 집어넣고 11시 이후로
시간을 변경하고서 시스템을 가동되도록 하면 되겠다는 생각이 들었습니다.
이 방법밖에 없는지요? 다른 방법이 있으면 가르쳐 주시고요.
장중 중간에 들어가서도 작동할 수 있도록 부탁드립니다.
이하 매매 방법입니다.
매수 준비 : 3분봉에서 주가가 주기가 33 이평선 위에 있고
현재봉이 도지 또는 음봉이 생기면 현재봉 바로 직전 첫째봉과
둘째봉이 연속 양봉이어야 합니다.
이 때 현재봉의 도지나 음봉의 시가를 매수기준가 라고 정의합니다.
매수 : 매수 기준가가 전날의 일봉 종가 대비 115% 이하이고 현재가가 매수 기준가를 돌파할 때 매수합니다.
손절 :3% 손실시 손절합니다.
이익청산 : 매수 후 5% 이익시 절반청산하고 이후에 하락하면 매수가 본전에서 나머지 전량청산합니다.
그리고
나머지 절반을 일단 상한가 매도를 걸어놓고 또 15 % 이익이 나면 나머지 전량 청산합니다.
안팔리면 매수이후에 1시간 될 때 전량 청산하고 메수후 혹시 1시간 이전에 장이 끝나게 되면 종가에 전량 청산합니다.
2021-05-04
1059
글번호 148656
시스템