커뮤니티
2291 보충질문
2004-08-12 17:01:08
1137
글번호 4817
질문한 수식의 CTL원문 입니다
선물 10분봉을 사용하였고 당일청산용입니다
=================================================================================
수식 1
=================================================================================
Var1= highd(1)-lowd(1) '전일 Range 를 var1에 입력
Cond1= exitname(1)="매수추적스탑" And tdate=exitdate(1) _
And exitprice(1)>opend+var1*len
' 청산이름이 "매수추적스탑"이고 청산일이 오늘이며 청산가격이 매수 진입가격보다 크면
' true 아니면 false
Cond2= exitname(1)="매도추적스탑" And tdate=exitdate(1) _
And exitprice(1)<opend-var1*len
' 청산이름이 "매도추적스탑"이고 청산일이 오늘이며 청산가격이 매도 진입가격보다 적으면
' true 아니면 false
If ttime<1500 Then
If Cond1=False Then ' cond1 이 거짓이면
Call buy("매수", Atstop, Def, opend+var1*len)
End If
If Cond2=False Then ' cond2가 거짓이면
Call sell("매도", Atstop, Def, opend-var1*len)
End If
End If
If position <>0 Then '현재 포지션이 없지 않다면, 1=매수 포지션, -1 = 매도 포지션
Call exitlong("매수추적스탑", Atstop, hhv(1, high, barnumsinceEntry+1)*(1-len1))
'매수 이후 최고 고가 대비 일정 비율 하락하면 청산하라
Call exitshort("매도추적스탑", Atstop, llv(1,low, barnumsinceEntry+1)*(1+len1))
'매도 이후 최고 저가 대비 일정 비율 상승하면 청산 하라
End If
=================================================================================
수식 2
=================================================================================
Var1=highd(1)-lowd(1) '전일고저차
If tdate(1)<>tdate Then '날짜가 바뀌면
Var10=currentEntrynum
End If
Cond1= tdate=exitdate(1) And position(1)=1 '최근청산날짜가 금일이고 직전이 매수
Cond2= tdate=exitdate(1) And position(1)=-1'최근청산날짜가 금일이고 직전이 매도
If ttime<1500 Then
'당일 진입횟수는 tcount로 제한하고 cond1이 거짓이면
If currentEntrynum < Var10+tcount And Cond1=False Then
Call buy("매수", Atstop, Def, opend+var1*len)'지정가 상향돌파시 매수
End If
'당일 진입횟수는 tcount로 제한하고 cond2이 거짓이면
If currentEntrynum < Var10+tcount And Cond2=False Then
Call sell("매도", Atstop, Def, opend-var1*len)'지정가 하향돌파시 매도
End If
End If
'청산
If position<>0 Then
Call exitlong("매수추적스탑",Atstop,hhv(1,high,barnumsinceEntry+1)-atr(atrlen)*len1)
Call exitshort("매도추적스탑",Atstop,llv(1,low,barnumsinceEntry+1)+atr(atrlen)*len1)
End If
================================================================================
위 수식은 조건만족과 동시에 신호가 발생하도록 되어있습니다
부탁드립니다...
답변 1
예스스탁 예스스탁 답변
2004-08-16 09:00:39
안녕하세요? 예스스탁입니다....
문의하신 내용을 예스트레이더 프로에서 사용 가능한지 확인해 보았으나 사용이 어려울 것으로 보였습니다.
우선, 언어에서 아직 구현이 되지 않는 부분(entryname, exitname, currententrynum 등)이 있기 때문이었습니다.
물론, 이 부분을 다른 언어로 대체해서 사용가능하게 해 보려고 시도를 해 보았으나 아직까지는 식 작성이 어려웠습니다...
원하시는 답을 드리지 못해서 죄송합니다...
> yunyu09 님이 쓴 글입니다.
> 제목 : 2291 보충질문
> 질문한 수식의 CTL원문 입니다
선물 10분봉을 사용하였고 당일청산용입니다
=================================================================================
수식 1
=================================================================================
Var1= highd(1)-lowd(1) '전일 Range 를 var1에 입력
Cond1= exitname(1)="매수추적스탑" And tdate=exitdate(1) _
And exitprice(1)>opend+var1*len
' 청산이름이 "매수추적스탑"이고 청산일이 오늘이며 청산가격이 매수 진입가격보다 크면
' true 아니면 false
Cond2= exitname(1)="매도추적스탑" And tdate=exitdate(1) _
And exitprice(1)<opend-var1*len
' 청산이름이 "매도추적스탑"이고 청산일이 오늘이며 청산가격이 매도 진입가격보다 적으면
' true 아니면 false
If ttime<1500 Then
If Cond1=False Then ' cond1 이 거짓이면
Call buy("매수", Atstop, Def, opend+var1*len)
End If
If Cond2=False Then ' cond2가 거짓이면
Call sell("매도", Atstop, Def, opend-var1*len)
End If
End If
If position <>0 Then '현재 포지션이 없지 않다면, 1=매수 포지션, -1 = 매도 포지션
Call exitlong("매수추적스탑", Atstop, hhv(1, high, barnumsinceEntry+1)*(1-len1))
'매수 이후 최고 고가 대비 일정 비율 하락하면 청산하라
Call exitshort("매도추적스탑", Atstop, llv(1,low, barnumsinceEntry+1)*(1+len1))
'매도 이후 최고 저가 대비 일정 비율 상승하면 청산 하라
End If
=================================================================================
수식 2
=================================================================================
Var1=highd(1)-lowd(1) '전일고저차
If tdate(1)<>tdate Then '날짜가 바뀌면
Var10=currentEntrynum
End If
Cond1= tdate=exitdate(1) And position(1)=1 '최근청산날짜가 금일이고 직전이 매수
Cond2= tdate=exitdate(1) And position(1)=-1'최근청산날짜가 금일이고 직전이 매도
If ttime<1500 Then
'당일 진입횟수는 tcount로 제한하고 cond1이 거짓이면
If currentEntrynum < Var10+tcount And Cond1=False Then
Call buy("매수", Atstop, Def, opend+var1*len)'지정가 상향돌파시 매수
End If
'당일 진입횟수는 tcount로 제한하고 cond2이 거짓이면
If currentEntrynum < Var10+tcount And Cond2=False Then
Call sell("매도", Atstop, Def, opend-var1*len)'지정가 하향돌파시 매도
End If
End If
'청산
If position<>0 Then
Call exitlong("매수추적스탑",Atstop,hhv(1,high,barnumsinceEntry+1)-atr(atrlen)*len1)
Call exitshort("매도추적스탑",Atstop,llv(1,low,barnumsinceEntry+1)+atr(atrlen)*len1)
End If
================================================================================
위 수식은 조건만족과 동시에 신호가 발생하도록 되어있습니다
부탁드립니다...
이전글