커뮤니티
재진입
2013-05-10 17:27:45
174
글번호 63067
수익이 0.7 이상 나다가 0.7 포인트 하락하면 익절 처리 한후
재진입 식을 넣었는데 재진입이 일어나지 않네요
교정좀 부탁합니다
//출처 : 7th감각 시스템트레이딩, p230
input : len(2.9), len1(0.53);
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(20)*len);
If marketposition==-1 then
exitshort("매도청산",Atstop,lowest(low,barsSinceEntry+1)+atr(20)*len);
// 매수 재진입
if MarketPosition == 0 and MarketPosition(1) == 1 and
c > exitprice(1) Then
buy("bb");
if MarketPosition == 1 and IsEntryName("bb") then
exitlong("bbx",Atstop,highest(high,barsSinceEntry+1)-atr(20)*len);
//매도 재진입
if MarketPosition == 0 and MarketPosition(1) == -1 and
c < exitprice(1) and var1 < 0 Then
sell("ss");
if MarketPosition == -1 and IsEntryName("ss") then
exitshort("ssx",Atstop,lowest(low,barsSinceEntry+1)+atr(20)*len);
if date==20130314 || date==20130613 || date==20130912 || date==20131212||
date==20140313 || date==20140612 || date==20140911 || date==20141211||
date==20150312 || date==20150611 || date==20150910 || date==20151210 then
setstopendofday(144855);
답변 1
예스스탁 예스스탁 답변
2013-05-10 18:28:36
안녕하세요
예스스탁입니다.
1. 직전 거래의 최고수익폭이 1포인트 이상일때만 재진입
input : len(2.9), len1(0.53);
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(20)*len);
If marketposition==-1 then
exitshort("매도청산",Atstop,lowest(low,barsSinceEntry+1)+atr(20)*len);
// 매수 재진입
if MarketPosition == 0 and
ExitDate(1) == sdate and
MarketPosition(1) == 1 and
c > exitprice(1) and
MaxPositionProfit(1) >= 1 Then
buy("bb");
if MarketPosition == 1 and IsEntryName("bb") then
exitlong("bbx",Atstop,highest(high,barsSinceEntry+1)-atr(20)*len);
//매도 재진입
if MarketPosition == 0 and
ExitDate(1) == sdate and
MarketPosition(1) == -1 and
c < exitprice(1) and
MaxPositionProfit(1) >= 1 Then
sell("ss");
if MarketPosition == -1 and IsEntryName("ss") then
exitshort("ssx",Atstop,lowest(low,barsSinceEntry+1)+atr(20)*len);
if date==20130314 || date==20130613 || date==20130912 || date==20131212||
date==20140313 || date==20140612 || date==20140911 || date==20141211||
date==20150312 || date==20150611 || date==20150910 || date==20151210 then
setstopendofday(144855);
2.
직전거래의 최대수익폭이 1포인트 이상이고
청산가격에서 최대수익폭의 절반까지 가격이 상승하거나 하락할때만 재진입
input : len(2.9), len1(0.53);
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(20)*len);
If marketposition==-1 then
exitshort("매도청산",Atstop,lowest(low,barsSinceEntry+1)+atr(20)*len);
// 매수 재진입
if MarketPosition == 0 and
stime < 150000 and
ExitDate(1) == sdate and
MarketPosition(1) == 1 and
MaxPositionProfit(1) >= 1 Then
buy("bb",AtStop,ExitPrice(1)+MaxPositionProfit(1)/2);
if MarketPosition == 1 and IsEntryName("bb") then
exitlong("bbx",Atstop,highest(high,barsSinceEntry+1)-atr(20)*len);
//매도 재진입
if MarketPosition == 0 and
stime < 150000 and
ExitDate(1) == sdate and
MarketPosition(1) == -1 and
MaxPositionProfit(1) >= 1 Then
sell("ss",AtStop,ExitPrice(1)-MaxPositionProfit(1)/2);
if MarketPosition == -1 and IsEntryName("ss") then
exitshort("ssx",Atstop,lowest(low,barsSinceEntry+1)+atr(20)*len);
if date==20130314 || date==20130613 || date==20130912 || date==20131212||
date==20140313 || date==20140612 || date==20140911 || date==20141211||
date==20150312 || date==20150611 || date==20150910 || date==20151210 then
setstopendofday(144855);
즐거운 하루되세요
> 구다이전설 님이 쓴 글입니다.
> 제목 : 재진입
> 수익이 0.7 이상 나다가 0.7 포인트 하락하면 익절 처리 한후
재진입 식을 넣었는데 재진입이 일어나지 않네요
교정좀 부탁합니다
//출처 : 7th감각 시스템트레이딩, p230
input : len(2.9), len1(0.53);
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(20)*len);
If marketposition==-1 then
exitshort("매도청산",Atstop,lowest(low,barsSinceEntry+1)+atr(20)*len);
// 매수 재진입
if MarketPosition == 0 and MarketPosition(1) == 1 and
c > exitprice(1) Then
buy("bb");
if MarketPosition == 1 and IsEntryName("bb") then
exitlong("bbx",Atstop,highest(high,barsSinceEntry+1)-atr(20)*len);
//매도 재진입
if MarketPosition == 0 and MarketPosition(1) == -1 and
c < exitprice(1) and var1 < 0 Then
sell("ss");
if MarketPosition == -1 and IsEntryName("ss") then
exitshort("ssx",Atstop,lowest(low,barsSinceEntry+1)+atr(20)*len);
if date==20130314 || date==20130613 || date==20130912 || date==20131212||
date==20140313 || date==20140612 || date==20140911 || date==20141211||
date==20150312 || date==20150611 || date==20150910 || date==20151210 then
setstopendofday(144855);