커뮤니티
문의드립니다
2010-12-17 11:44:38
636
글번호 34405
안녕하세요.
아래 첨부한 시스템식을 call / put 매수전용 시스템식으로 변경하고자 합니다.
매수신호는 call 매수만하고, 매도신호는 put 매수만하고자합니다.
제가 아래와 같이 call매수만작성하였더니 매수후 매도신호에의하여 바로청산됩니다.
############################################################################
If stime<150000 then {
If condition1==False And currententrynum-var50<=2 and marketposition <>1 then
buy("매수",Atstop,dayLow+var1*len1); //지정가 상향돌파시 매수
}
//청산
If marketposition==1 then
exitlong("매수청산1",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len);
If marketposition==1 then
exitlong("매수청산2",Atstop,dayHigh-var1*len1);
################################################
input : len1(0.65), len(3),n(20);
var : CurrentEntryNum(0);
Var1=dayhigh(1)-dayLow(1); //전일 고저차
condition1= sdate==exitdate(1) And marketposition(1)==1; //청산날짜가 오늘날짜이고 직전포지션이 매수
condition2= sdate==exitdate(1) And marketposition(1)==-1;//청산날짜가 오늘날짜이고 직전포지션이 매도
if date<>date[1] Then { //날이 바뀐 첫봉에서
var50 = TotalTrades; //진입횟수 체크
Var10=atr(20)*len1; //당일의 var10 설정
}
CurrentEntryNum = iff(marketposition == 0,TotalTrades, TotalTrades+1 );
//하루에 3번만 진입
If stime<150000 then {
If condition1==False And currententrynum-var50<=2 and marketposition <>1 then
buy("매수",Atstop,dayLow+var1*len1); //지정가 상향돌파시 매수
If condition2==False And currententrynum-var50<=2 and marketposition <>-1 then
sell("매도",Atstop,dayHigh-var1*len1); //지정가 하향돌파시 매도
}
//청산
If marketposition==1 then
exitlong("매수청산",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len);
If marketposition==-1 then
exitshort("매도청산",Atstop,lowest(low,barsSinceEntry+1)+atr(n)*len);
미리감사드립니다.
즐거운 주말보내세요.
답변 1
예스스탁 예스스탁 답변
2010-12-17 16:57:09
안녕하세요
예스스탁입니다.
1. 콜(기존매수식)
input : len1(0.65), len(3),n(20);
var : CurrentEntryNum(0);
Var1=dayhigh(1)-dayLow(1); //전일 고저차
condition1= sdate==exitdate(1) And marketposition(1)==1; //청산날짜가 오늘날짜이고 직전포지션이 매수
condition2= sdate==exitdate(1) And marketposition(1)==-1;//청산날짜가 오늘날짜이고 직전포지션이 매도
if date<>date[1] Then { //날이 바뀐 첫봉에서
var50 = TotalTrades; //진입횟수 체크
Var10=atr(20)*len1; //당일의 var10 설정
}
CurrentEntryNum = iff(marketposition == 0,TotalTrades, TotalTrades+1 );
If stime<150000 then {
If condition1==False And currententrynum-var50<=2 and marketposition <> 1 then
buy("매수",Atstop,dayLow+var1*len1); //지정가 상향돌파시 매수
}
//청산
If marketposition==1 then
exitlong("매수청산1",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len);
If marketposition==1 then
exitlong("매수청산2",Atstop,dayHigh-var1*len1);
2. 풋(기존매도 --> 매수)
input : len1(0.65), len(3),n(20);
var : CurrentEntryNum(0);
Var1=dayhigh(1)-dayLow(1); //전일 고저차
condition1= sdate==exitdate(1) And marketposition(1)==1; //청산날짜가 오늘날짜이고 직전포지션이 매수
condition2= sdate==exitdate(1) And marketposition(1)==-1;//청산날짜가 오늘날짜이고 직전포지션이 매도
if date<>date[1] Then { //날이 바뀐 첫봉에서
var50 = TotalTrades; //진입횟수 체크
Var10=atr(20)*len1; //당일의 var10 설정
}
CurrentEntryNum = iff(marketposition == 0,TotalTrades, TotalTrades+1 );
If stime<150000 then {
If condition2==False And currententrynum-var50<=2 and marketposition <> 1 then
Buy("매도",AtLimit,dayHigh-var1*len1); //지정가 하향돌파시 매도
}
If marketposition==1 then
ExitLong("매도청산",Atlimit,lowest(low,barsSinceEntry+1)+atr(n)*len);
즐거운 하루되세요
> 베드로 님이 쓴 글입니다.
> 제목 : 문의드립니다
> 안녕하세요.
아래 첨부한 시스템식을 call / put 매수전용 시스템식으로 변경하고자 합니다.
매수신호는 call 매수만하고, 매도신호는 put 매수만하고자합니다.
제가 아래와 같이 call매수만작성하였더니 매수후 매도신호에의하여 바로청산됩니다.
############################################################################
If stime<150000 then {
If condition1==False And currententrynum-var50<=2 and marketposition <>1 then
buy("매수",Atstop,dayLow+var1*len1); //지정가 상향돌파시 매수
}
//청산
If marketposition==1 then
exitlong("매수청산1",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len);
If marketposition==1 then
exitlong("매수청산2",Atstop,dayHigh-var1*len1);
################################################
input : len1(0.65), len(3),n(20);
var : CurrentEntryNum(0);
Var1=dayhigh(1)-dayLow(1); //전일 고저차
condition1= sdate==exitdate(1) And marketposition(1)==1; //청산날짜가 오늘날짜이고 직전포지션이 매수
condition2= sdate==exitdate(1) And marketposition(1)==-1;//청산날짜가 오늘날짜이고 직전포지션이 매도
if date<>date[1] Then { //날이 바뀐 첫봉에서
var50 = TotalTrades; //진입횟수 체크
Var10=atr(20)*len1; //당일의 var10 설정
}
CurrentEntryNum = iff(marketposition == 0,TotalTrades, TotalTrades+1 );
//하루에 3번만 진입
If stime<150000 then {
If condition1==False And currententrynum-var50<=2 and marketposition <>1 then
buy("매수",Atstop,dayLow+var1*len1); //지정가 상향돌파시 매수
If condition2==False And currententrynum-var50<=2 and marketposition <>-1 then
sell("매도",Atstop,dayHigh-var1*len1); //지정가 하향돌파시 매도
}
//청산
If marketposition==1 then
exitlong("매수청산",Atstop,highest(high,barsSinceEntry+1)-atr(n)*len);
If marketposition==-1 then
exitshort("매도청산",Atstop,lowest(low,barsSinceEntry+1)+atr(n)*len);
미리감사드립니다.
즐거운 주말보내세요.
다음글
이전글