커뮤니티
시스템식 변환 요청
2009-08-21 14:39:22
651
글번호 24347
예스 트레이더에 맞게 변환 요청합니다.
settestmode
'디마크 설정
If opend>closed(1) Then '시가가 전일종가보다 크면
Var1=(highd(1)+closed(1)+2*lowd(1))/2-lowd(1)
Var2=(highd(1)+closed(1)+2*lowd(1))/2-highd(1)
Elseif opend<closed(1) Then'시가가 전일종가보다 작으면
Var1=(2*highd(1)+closed(1)+lowd(1))/2-lowd(1)
Var2=(2*highd(1)+closed(1)+lowd(1))/2-highd(1)
Else '두조건다 아니라면
Var1=(highd(1)+2*closed(1)+lowd(1))/2-lowd(1)
Var2=(highd(1)+2*closed(1)+lowd(1))/2-highd(1)
End If
Cond1= tdate=exitdate(1) And position(1)=1 '최근청산날짜가 금일이고 직전이 매수
Cond2= tdate=exitdate(1) And position(1)=-1'최근청산날짜가 금일이고 직전이 매도
'진입
If ttime<1500 Then
If Cond1=False Then
If opend>var1 Then '시가가 var1보다 크면
Call buy("매수1",Atstop,Def,opend+(Var1-var2)*len1)'지정가 상향돌파시 매수
End If
If opend<var2 Then '시가가 var2보다 작으면
Call buy("매수4",Atstop,Def,Var2) '지정가 상향돌파시 매수
End If
End If
If Cond2=False Then
If opend>var1 Then '시가가 var1보다 크면
Call sell("매도1",Atstop,Def,Var1)'지정가 하향돌파시 매도
End If
If opend<var2 Then '시가가 var2보다 작으면
Call sell("매도4",Atstop,Def,opend-(Var1-var2)*len1) '지정가 하향돌파시 매도
End If
End If
End If
'청산
If position<>0 Then
Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*len)
Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*len)
End If
답변 1
예스스탁 예스스탁 답변
2009-08-21 16:22:43
안녕하세요
예스스탁입니다.
설명이 없는 외부변수는 모두 1로 처리했습니다.
input : len1(1),len(1);
var : cond1(False),cond2(false);
If dayopen>dayclose(1) Then {# '시가가 전일종가보다 크면
Var1=(dayhigh(1)+dayclose(1)+2*daylow(1))/2-daylow(1);
Var2=(dayhigh(1)+dayclose(1)+2*daylow(1))/2-dayhigh(1);
}
Else if dayopen<dayclose(1) Then{ #'시가가 전일종가보다 작으면
Var1=(2*dayhigh(1)+dayclose(1)+daylow(1))/2-daylow(1);
Var2=(2*dayhigh(1)+dayclose(1)+daylow(1))/2-dayhigh(1);
}
Else{ #'두조건다 아니라면
Var1=(dayhigh(1)+2*dayclose(1)+daylow(1))/2-daylow(1);
Var2=(dayhigh(1)+2*dayclose(1)+daylow(1))/2-dayhigh(1);
}
Cond1= sdate==exitdate(1) And MarketPosition(1) == 1;# '최근청산날짜가 금일이고 직전이 매수
Cond2= sdate==exitdate(1) And MarketPosition(1) == -1;#'최근청산날짜가 금일이고 직전이 매도
If sTime<150000 Then{
If Cond1==False Then{
If dayopen>var1 Then{ #'시가가 var1보다 크면
buy("매수1",Atstop,dayopen+(Var1-var2)*len1);#'지정가 상향돌파시 매수
}
If DayOpen<var2 Then{ # '시가가 var2보다 작으면
buy("매수4",Atstop,Def,Var2);# '지정가 상향돌파시 매수
}
}
If Cond2=False Then{
If dayopen>var1 Then{# '시가가 var1보다 크면
sell("매도1",Atstop,Var1);#'지정가 하향돌파시 매도
}
If dayopen<var2 Then {# '시가가 var2보다 작으면
sell("매도4",Atstop,dayopen-(Var1-var2)*len1);# '지정가 하향돌파시 매도
}
}
}
If MarketPosition<>0 Then{
exitlong("매수청산",Atstop,NthHighest(1,high,BarsSinceEntry+1)-atr(20)*len);
exitshort("매도청산",Atstop,NthLowest(1,low,BarsSinceEntry+1)+atr(20)*len);
}
즐거운 하루되세요
> HI_coco 님이 쓴 글입니다.
> 제목 : 시스템식 변환 요청
> 예스 트레이더에 맞게 변환 요청합니다.
settestmode
'디마크 설정
If opend>closed(1) Then '시가가 전일종가보다 크면
Var1=(highd(1)+closed(1)+2*lowd(1))/2-lowd(1)
Var2=(highd(1)+closed(1)+2*lowd(1))/2-highd(1)
Elseif opend<closed(1) Then'시가가 전일종가보다 작으면
Var1=(2*highd(1)+closed(1)+lowd(1))/2-lowd(1)
Var2=(2*highd(1)+closed(1)+lowd(1))/2-highd(1)
Else '두조건다 아니라면
Var1=(highd(1)+2*closed(1)+lowd(1))/2-lowd(1)
Var2=(highd(1)+2*closed(1)+lowd(1))/2-highd(1)
End If
Cond1= tdate=exitdate(1) And position(1)=1 '최근청산날짜가 금일이고 직전이 매수
Cond2= tdate=exitdate(1) And position(1)=-1'최근청산날짜가 금일이고 직전이 매도
'진입
If ttime<1500 Then
If Cond1=False Then
If opend>var1 Then '시가가 var1보다 크면
Call buy("매수1",Atstop,Def,opend+(Var1-var2)*len1)'지정가 상향돌파시 매수
End If
If opend<var2 Then '시가가 var2보다 작으면
Call buy("매수4",Atstop,Def,Var2) '지정가 상향돌파시 매수
End If
End If
If Cond2=False Then
If opend>var1 Then '시가가 var1보다 크면
Call sell("매도1",Atstop,Def,Var1)'지정가 하향돌파시 매도
End If
If opend<var2 Then '시가가 var2보다 작으면
Call sell("매도4",Atstop,Def,opend-(Var1-var2)*len1) '지정가 하향돌파시 매도
End If
End If
End If
'청산
If position<>0 Then
Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*len)
Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*len)
End If
다음글