예스스탁
예스스탁 답변
2011-12-26 10:52:57
안녕하세요
예스스탁입니다.
1.
cond = ExitDate(1) == sdate and
(IsExitName("BP1",1) or IsExitName("BP2",1) or IsExitName("SP1",1) or IsExitName("SP2",1) or IsExitName("bxxx",1) or IsExitName("Sxxx",1));
2번 청산조건은 청산후 금일 모든매매종료를 제외하고자 하시면 위수식 아래내용에서 IsExitName("bxxx",1) , IsExitName("Sxxx",1)
를 제외하고 아래와 같이 작성하시면 됩니다.
cond = ExitDate(1) == sdate and
(IsExitName("BP1",1) or IsExitName("BP2",1) or IsExitName("SP1",1) or IsExitName("SP2",1));
2,
양봉음봉 카운트 부분에 오류가 있습니다.
아래와 같이 변경하시기 바랍니다.
input : 하루이익1(2);
var : PLR(0),XCommission(0,data1),XSlippage(0,data1),OpenPL(0,data1),dayPL(0,data1),count(0,data1),aa(0,data1);
var : mav1(0,data1),mav2(0,data1),mav3(0,data1),mav4(0,data1),cond(false,data1);
var : bcond1(false,data1),B1idx(0,data1),bcond2(false,data1),B2idx(0,data1);
var : Scond1(false,data1),S1idx(0,data1),Scond2(false,data1),S2idx(0,data1);
var : d2Y(0,data2),d3Y(0,data3),D4Y(0,data4),Bxcond1(false,data1),Bxidx(0,data1);
var : d2E(0,data2),d3E(0,data3),D4E(0,data4),Sxcond1(false,data1),Sxidx(0,data1);
if data1(dayindex+1 == 1) Then
Bcond1 = false;
if data2(dayindex ==0) Then
d2Y = 0;
if data2(dayindex+1 == 3 and countif(C>O,3)==3) or data2(dayindex+1 > 3 and !(C[4]>O[4]) and countif(C>O,3)==3) Then
d2Y = d2Y+1;
if data2(dayindex+1 == 3 and countif(C<O,3)==3) or data2(dayindex+1 > 3 and !(C[4]<O[4]) and countif(C<O,3)==3) Then
d2E = d2E+1;
if data3(dayindex ==0) Then
d3Y = 0;
if data3(dayindex+1 == 3 and countif(C>O,3)==3) or data3(dayindex+1 > 3 and !(C[4]>O[4]) and countif(C>O,3)==3) Then
d3Y = d3Y+1;
if data3(dayindex+1 == 3 and countif(C<O,3)==3) or data3(dayindex+1 > 3 and !(C[4]<O[4]) and countif(C<O,3)==3) Then
d3E = d3E+1;
if data4(dayindex ==0) Then
d4Y = 0;
if data4(dayindex+1 == 3 and countif(C>O,3)==3) or data4(dayindex+1 > 3 and !(C[4]>O[4]) and countif(C>O,3)==3) Then
d4Y = d4Y+1;
if data4(dayindex+1 == 3 and countif(C<O,3)==3) or data4(dayindex+1 > 3 and !(C[4]<O[4]) and countif(C<O,3)==3) Then
d4E = d4E+1;
if data1(dayindex+1 >= 7 and dayindex+1 <= 33) and cond == false Then{
if data8(countif(c<O,3) == 3) and data9(countif(C>O,3) == 3) and data10(countif(C>O,3)== 3) And
data2(iff(C>O,1,0))+data3(iff(C>O,1,0))+data4(iff(C>O,1,0)) >= 1 Then{
Bcond1 = true;
B1idx = data1(index);
}
if Bcond1 == true and data1(index) <= B1idx+7 and data1(C> ma(c,5)) Then
buy();
}
if MarketPosition == 1 Then
Bcond1 = false;
if data1(dayindex+1 >= 7 and dayindex+1 <= 33) and cond == false Then{
if data8(countif(c>O,3) == 3) and data9(countif(C<O,3) == 3) and data10(countif(C<O,3)== 3) And
data2(iff(C<O,1,0))+data3(iff(C<O,1,0))+data4(iff(C<O,1,0)) >= 1 Then{
Scond1 = true;
S1idx = data1(index);
}
if Scond1 == true and data1(index) <= B1idx+7 and data1(C<ma(c,5)) Then
Sell();
}
if MarketPosition == -1 Then
Scond1 = false;
즐거운 하루되세요
> 강태공3 님이 쓴 글입니다.
> 제목 : 수식 수정부탁드립니다.
> <html>
<head>
<title>제목없음</title>
<meta name="generator" content="Namo WebEditor v4.0">
</head>
<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">
<p style="line-height:125%; margin-top:0; margin-bottom:0;">안녕하세요.</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">어제 만들어주신
수식 22114번에 문제가 있어서 수정부탁드립니다.</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">처음에 천제를 테스트하니
원하는 곳에서 신호가 거의 나오지 않아서 </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">제가 테스트 삼아서
만들어 주신 수식에서 1-(1) 번 진입조건만 (단 데이타2,3,4 중에 3봉연속 음봉이 2개이상이면
안됨) 의 진입제한 조건을 제외하고</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">아래와 같이 테스트를
해보았는데 신호가 첨부파일에서 보듯이 이상하게 나옵니다.</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">설정은 데이타2부터
7까지는 선물을 참조로 놓고</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">데이타8을 주식 <다음>으로
하고 데이타 9.10 을 선물로 참조데이타를 두고 테스트했습니다.</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">날짜는 2011년 12/21일
2분봉입니다.</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">보시다 싶이 첫번째
매수신호는 정상적으로 나왔는데 두번째 매도신호가 <<<font color="black">데이타8 이 연속 3봉이 양봉이고 데이타9.10이 연속 3봉이
음봉이고 데이타2,3,4 중에 음봉이 1개이상이면 그 이후에 7봉이내에 선물이 5이평보다
작으면 매도>> 조건을 전혀 만족하지 않는데 매도신호가 나왔습니다.</font></p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"><font color="black">그리고
그 다음에 나온 매수신호는 앞에서 이미 조건을 만족하여 7봉 이내에 매수가 한번
나왔기 때문에 그 다음에 7봉이내 조건이 만족하여 다시 매수신호가 나온것은</font></p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"><font color="black">나오지
않게 해주세요.</font></p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"><font color="red">그러니까
결론은 매수조건을 만족하고 그 이후 7봉이내에는 매수가 1번만 나오게 해주세요.</font></p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"><font color="red">반대로
매도조건을 만족하고 그 이후 7봉이내에도 매도가 1번만 나오게 해주세요.</font></p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"><font color="black"> </font></p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"><font color="black">이를
바탕으로 22114번 답변 수식 전체적으로 다시 재수정 부탁드립니다. 특히 진입제한
조건도 문제가 없는지 다시 잘 검토해주시고요.</font></p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"><font color="black">그리고
2번 청산조건은 </font><font color="red">청산후 금일 모든매매종료라고 했는데
종료하지 말고 그냥 청산으로 변경해주세요.</font></p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"><font color="black">이해
안되시면 전화주세요. 010-3044-6622</font></p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">var : PLR(0),XCommission(0,data1),XSlippage(0,data1),OpenPL(0,data1),dayPL(0,data1),count(0,data1),aa(0,data1);
</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">var : mav1(0,data1),mav2(0,data1),mav3(0,data1),mav4(0,data1),mav5(0,data1),mav6(0,data1),mav7(0,data1),cond(false,data1);</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">var : bcond1(false,data1),B1idx(0,data1),bcond2(false,data1),B2idx(0,data1);</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">var : Scond1(false,data1),S1idx(0,data1),Scond2(false,data1),S2idx(0,data1);</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">var : d2Y(0,data2),d3Y(0,data3),D4Y(0,data4),Bxcond1(false,data1),Bxidx(0,data1);</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">var : d2E(0,data2),d3E(0,data3),D4E(0,data4),Sxcond1(false,data1),Sxidx(0,data1);</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">if data1(dayindex+1
== 1) Then</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> Bcond1
= false;</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">if data2(dayindex
==0) Then</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> d2Y
= 0;</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">if data2(dayindex+1
== 3 and countif(C<O,3)==3) or data2(dayindex+1 > 3 and !(C[4] < O[4])
and countif(C<O,3)==3) Then</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> d2Y
= d2Y+1;</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">if data2(dayindex+1
== 3 and countif(C>O,3)==3) or data2(dayindex+1 > 3 and !(C[4] > O[4])
and countif(C>O,3)==3) Then</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> d2E
= d2E+1;</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">if data3(dayindex
==0) Then</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> d3Y
= 0;</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">if data3(dayindex+1
== 3 and countif(C< O,3)==3) or data3(dayindex+1 > 3 and !(C[4] < O[4])
and countif(C<O,3)==3) Then</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> d3Y
= d3Y+1;</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">if data3(dayindex+1
== 3 and countif(C>O,3)==3) or data3(dayindex+1 > 3 and !(C[4] > O[4])
and countif(C>O,3)==3) Then</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> d3E
= d3E+1;</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">if data4(dayindex
==0) Then</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> d4Y
= 0;</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">if data4(dayindex+1
== 3 and countif(C>O,3)==3) or data4(dayindex+1 > 3 and !(C[4] > O[4])
and countif(C>O,3)==3) Then</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> d4Y
= d4Y+1;</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">if data4(dayindex+1
== 3 and countif(C< O,3)==3) or data4(dayindex+1 > 3 and !(C[4] < O[4])
and countif(C<O,3)==3) Then</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> d4E
= d4E+1;</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">if data1(dayindex+1
>= 7 and dayindex+1 <= 133) and cond == false Then{</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> if
data8(countif(c<O,3) == 3) and data9(countif(C>O,3) == 3) and data10(countif(C>O,3)==
3) And</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> data2(iff(C>O,1,0))+data3(iff(C>O,1,0))+data4(iff(C>O,1,0))
>= 1 Then{</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> Bcond1
= true;</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> B1idx
= data1(index);</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> }</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> if
Bcond1 == true and data1(index) <= B1idx+7 and data1(C> ma(c,5)) Then</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> buy();</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> }</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;">if data1(dayindex+1
>= 7 and dayindex+1 <= 133) and cond == false Then{</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> if
data8(countif(c>O,3) == 3) and data9(countif(C<O,3) == 3) and data10(countif(C<O,3)==
3) And</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> data2(iff(C<O,1,0))+data3(iff(C<O,1,0))+data4(iff(C<O,1,0))
>= 1 Then{</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> Scond1
= true;</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> S1idx
= data1(index);</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> }</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> if
Scond1 == true and data1(index) <= B1idx+7 and data1(C<ma(c,5)) Then</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> Sell();</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> }</p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
<p style="line-height:125%; margin-top:0; margin-bottom:0;"> </p>
</body>
</html>