커뮤니티
시스템식 수정
2013-08-20 00:22:39
134
글번호 66619
감사드립니다
아래식을 구현해보니 3번째신호부터 진입신호가 나오는것이 아니라 첫신호부터 나옵니다
수정부탁드립니다
var : count(0);
if date != date[1] Then
count = 0;
if (stime >= 090200 and stime < 143000) Then{
Condition1 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and
MarketPosition(1) == 1;
Condition2 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and
MarketPosition(1) == -1;
if (c>o and var10 == 1 and var20==1 ) and
((MarketPosition == 0 and Condition1 == false) or MarketPosition == -1) Then{
count = count+1;
if count >= 3 Then
buy("B1");
}
if (c<o and var10 == -1 and var20==-1 ) and
((MarketPosition == 0 and Condition2 == false) or MarketPosition == 1) Then{
count = count+1;
if count >= 3 Then
sell("S1") ;
}
}
감사합니다
답변 2
예스스탁 예스스탁 답변
2013-08-20 15:15:11
> 조민철 님이 쓴 글입니다.
> 제목 : 시스템식 수정
> 감사드립니다
아래식을 구현해보니 3번째신호부터 진입신호가 나오는것이 아니라 첫신호부터 나옵니다
수정부탁드립니다
var : count(0);
if date != date[1] Then
count = 0;
if (stime >= 090200 and stime < 143000) Then{
Condition1 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and
MarketPosition(1) == 1;
Condition2 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and
MarketPosition(1) == -1;
if (c>o and var10 == 1 and var20==1 ) and
((MarketPosition == 0 and Condition1 == false) or MarketPosition == -1) Then{
count = count+1;
if count >= 3 Then
buy("B1");
}
if (c<o and var10 == -1 and var20==-1 ) and
((MarketPosition == 0 and Condition2 == false) or MarketPosition == 1) Then{
count = count+1;
if count >= 3 Then
sell("S1") ;
}
}
감사합니다
예스스탁 예스스탁 답변
2013-08-20 16:40:11
안녕하세요
예스스탁입니다.
아래식 참고하시기 바랍니다.
var : count(0),MP(0),EP(0),PreMP(0),ii(0);
var : cnt(0),Entry(0);
entry = 0;
for cnt = 0 to 20{
if sdate == EntryDate(cnt) Then
entry = entry+1;
}
if date != date[1] Then{
count = 0;
MP = 0;
}
Condition1 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and MarketPosition(1) == 1;
Condition2 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and MarketPosition(1) == -1;
if (stime >= 090200 and stime < 143000) Then{
//첫진입(가상)
if count == 0 and MP == 0 and (c > o and var10 == 1 and var20 == 1) Then{
count = 1;
MP = 1;
EP = C;
ii = index;
}
if count == 0 and MP == 0 and (c < o and var10 == -1 and var20 == -1) Then{
count = 1;
MP = -1;
EP = C;
ii = index;
}
//가상 - 첫진입(매수)에 대한 손절 또는 리버스
if count == 1 and MP == 1 and index > ii Then{
//매도로 리버스
if (c < o and var10 == -1 and var20 == -1) Then{
count = 2;
MP = -1;
ii = index;
}
//첫진입 매수 손절
if L <= EP-0.5 Then{
PreMP = 1;
MP = 0;
}
}
//가상 - 첫진입(매도)에 대한 손절 또는 리버스
if count == 1 and MP == -1 and index > ii Then{
//매수로 리버스
if (c > o and var10 == 1 and var20 == 1) Then{
count = 2;
MP = 1;
ii = index;
}
//손절
if H >= EP+0.5 Then{
PreMP = -1;
MP = 0;
}
}
#가상 - 첫진입 손절 후 반대 방향으로만 진입
if count == 1 and MP == 0 Then{
if PreMP == -1 and (c > o and var10 == 1 and var20 == 1) Then{
count = 2;
MP = 1;
EP = C;
ii = index;
}
if PreMP == 1 and (c < o and var10 == -1 and var20 == -1) Then{
count = 2;
MP = -1;
EP = C;
ii = index;
}
}
//가상 - 두번째 진입(매수)에 대한 손절 또는 리버스
if count == 1 and MP == 1 and index > ii Then{
//매도로 리버스
if entry == 0 and (c < o and var10 == -1 and var20 == -1) Then{
sell();
count = 3;
}
//첫진입 매수 손절
if L <= EP-0.5 Then{
PreMP = 1;
MP = 0;
}
}
//가상 - 두번째 진입(매도)에 대한 손절 또는 리버스
if count == 1 and MP == -1 and index > ii Then{
//매수로 리버스(3번째 진입신호 임으로 진입)
if entry == 0 and (c > o and var10 == 1 and var20 == 1) Then{
buy();
count = 3;
}
//손절
if H >= EP+0.5 Then{
PreMP = -1;
MP = 0;
}
}
}
#두번째 가상신호가 손절로 끝났을 경우 실제 첫진입
if entry == 0 Then{
if (c>o and var10 == 1 and var20==1 ) and count == 2 and MP == 0 and PreMP == -1 Then
buy("B1");
if (c<o and var10 == -1 and var20==-1 ) and count == 2 and MP == 0 and PreMP == 1 Then
sell("S1") ;
}
if (stime >= 090200 and stime < 143000) and entry >= 1 Then{
if (c>o and var10 == 1 and var20==1 ) and
((MarketPosition == 0 and Condition1 == false) or MarketPosition == -1) Then{
count = count+1;
if count >= 3 Then
buy("B11");
}
if (c<o and var10 == -1 and var20==-1 ) and
((MarketPosition == 0 and Condition2 == false) or MarketPosition == 1) Then{
count = count+1;
if count >= 3 Then
sell("S11") ;
}
}
SetStopLoss(0.5,PointStop);
즐거운 하루되세요
> 조민철 님이 쓴 글입니다.
> 제목 : 시스템식 수정
> 감사드립니다
아래식을 구현해보니 3번째신호부터 진입신호가 나오는것이 아니라 첫신호부터 나옵니다
수정부탁드립니다
var : count(0);
if date != date[1] Then
count = 0;
if (stime >= 090200 and stime < 143000) Then{
Condition1 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and
MarketPosition(1) == 1;
Condition2 = ExitDate(1) == sdate and IsExitName("StopLoss",1) == true and
MarketPosition(1) == -1;
if (c>o and var10 == 1 and var20==1 ) and
((MarketPosition == 0 and Condition1 == false) or MarketPosition == -1) Then{
count = count+1;
if count >= 3 Then
buy("B1");
}
if (c<o and var10 == -1 and var20==-1 ) and
((MarketPosition == 0 and Condition2 == false) or MarketPosition == 1) Then{
count = count+1;
if count >= 3 Then
sell("S1") ;
}
}
감사합니다
다음글