커뮤니티

시스템식 변환요청

프로필 이미지
회원
2009-08-20 14:56:29
918
글번호 24331
답변완료
예스 트레이더에 맞게 변환 요청합니다. settestmode Var1=hhv(1,high,len)-llv(1,low,len) '기간중 고저차값 Var2=high-low '고저차 Var3=mov(Var2,len,S)*multi '고저차의 이평 승수배 Cond1= tdate=exitdate(1) And position(1)=1 '최근청산날짜가 금일이고 직전이 매수 Cond2= tdate=exitdate(1) And position(1)=-1 If Var1<var3 Then '기간중 고저차값과 고저차 이평의 승수배 비교 Var10=1 Else Var10=0 End If If hhv(1,Var10,delay)=1 Then '기간중 최고 var10이 1이면 '진입 If ttime<1500 Then If Cond1=False Then Call buy("매수1",Atstop,Def,lowd+(highd(1)-lowd(1))*s1) '지정가 상향돌파시 매수 End If If Cond2=False Then Call sell("매도1",Atstop,Def,highd-(highd(1)-lowd(1))*s1) '지정가 하향돌파시 매도 End If End If End If '청산 If position<>0 Then Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2) Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s2) End If
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2009-08-20 15:28:35

안녕하세요 예스스탁입니다. 외부변수는 특별한 언급이 없어 임의로 설정한 것입니다. 전략에 맞게 변경하시기 바랍니다. input : len(10),multi(2.5),delay(3),s1(2),s2(2); var : cond1(False),cond2(False); Var1=NthHighest(1,high,len)-NthLowest(1,low,len);#기간중 고저차값 Var2=high-low;#'고저차 Var3=Ma(Var2,len)*multi; #'고저차의 이평 승수배 Cond1 = sDate==exitdate(1) And MarketPosition(1) == 1; #'최근청산날짜가 금일이고 직전이 매수 Cond2 = sdate==exitdate(1) And MarketPosition(1) == -1; If Var1<var3 Then# '기간중 고저차값과 고저차 이평의 승수배 비교 Var10=1; Else Var10=0; If NthHighest(1,Var10,delay)==1 Then {# '기간중 최고 var10이 1이면 #'진입 If stime < 150000 Then{ If Cond1==False Then buy("매수1",Atstop,daylow+(dayhigh(1)-daylow(1))*s1);#지정가 상향돌파시 매수 If Cond2==False Then sell("매도1",Atstop,dayhigh-(dayhigh(1)-daylow(1))*s1);# '지정가 하향돌파시 매도 } } #'청산 If MarketPosition<>0 Then{ exitlong("매수청산",Atstop,NthHighest(1,high,BarsSinceEntry+1)-atr(20)*s2); exitshort("매도청산",Atstop,NthLowest(1,low,BarsSinceEntry+1)+atr(20)*s2); } 즐거운 하루되세요 > HI_coco 님이 쓴 글입니다. > 제목 : 시스템식 변환요청 > 예스 트레이더에 맞게 변환 요청합니다. settestmode Var1=hhv(1,high,len)-llv(1,low,len) '기간중 고저차값 Var2=high-low '고저차 Var3=mov(Var2,len,S)*multi '고저차의 이평 승수배 Cond1= tdate=exitdate(1) And position(1)=1 '최근청산날짜가 금일이고 직전이 매수 Cond2= tdate=exitdate(1) And position(1)=-1 If Var1<var3 Then '기간중 고저차값과 고저차 이평의 승수배 비교 Var10=1 Else Var10=0 End If If hhv(1,Var10,delay)=1 Then '기간중 최고 var10이 1이면 '진입 If ttime<1500 Then If Cond1=False Then Call buy("매수1",Atstop,Def,lowd+(highd(1)-lowd(1))*s1) '지정가 상향돌파시 매수 End If If Cond2=False Then Call sell("매도1",Atstop,Def,highd-(highd(1)-lowd(1))*s1) '지정가 하향돌파시 매도 End If End If End If '청산 If position<>0 Then Call exitlong("매수청산",Atstop,hhv(1,high,barnumsinceentry+1)-atr(20)*s2) Call exitshort("매도청산",Atstop,llv(1,low,barnumsinceentry+1)+atr(20)*s2) End If