커뮤니티

ct로 작성된...전략..

프로필 이미지
rlaxoeh
2012-03-19 18:07:31
310
글번호 49094
답변완료
안녕하세요.. 대신증권 ct로 작성된건데... 예스트레이더 언어로 바꿔 주세요 부탁 드립니다. Input: len(3.2), len1(0.34) 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 Call buy("매수1",Atstop,Def,opend+(Var1-var2)*len1) End If If opend<var2 Then Call buy("매수4",Atstop,Def,Var2) End If End If If Cond2=False Then If opend>var1 Then Call sell("매도1",Atstop,Def,Var1) End If If opend<var2 Then 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
프로필 이미지

예스스탁 예스스탁 답변

2012-03-20 08:56:58

안녕하세요 예스스탁입니다. Input: len(3.2), len1(0.34); var : cnt(0),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 = false; cond2 = false; for cnt = 0 to 10{ if EntryDate(cnt) == sdate and MarketPosition(cnt) == 1 Then cond1 = true; if EntryDate(cnt) == sdate and MarketPosition(cnt) == -1 Then cond2 = true; } If stime < 150000 Then{ If Cond1==False Then{ If DayOpen>var1 Then buy("매수1",Atstop,DayOpen+(Var1-var2)*len1); If DayOpen<var2 Then buy("매수4",Atstop,Var2); } If Cond2==False Then{ If DayOpen>var1 Then sell("매도1",Atstop,Var1); If DayOpen<var2 Then sell("매도4",Atstop,DayOpen-(Var1-var2)*len1); } } If marketposition<>0 Then{ exitlong("매수청산",Atstop,highest(high,barssinceentry+1)-atr(20)*len); exitshort("매도청산",Atstop,Lowest(low,barssinceentry+1)+atr(20)*len); } 즐거운 하루되세요 > rlaxoeh 님이 쓴 글입니다. > 제목 : ct로 작성된...전략.. > 안녕하세요.. 대신증권 ct로 작성된건데... 예스트레이더 언어로 바꿔 주세요 부탁 드립니다. Input: len(3.2), len1(0.34) 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 Call buy("매수1",Atstop,Def,opend+(Var1-var2)*len1) End If If opend<var2 Then Call buy("매수4",Atstop,Def,Var2) End If End If If Cond2=False Then If opend>var1 Then Call sell("매도1",Atstop,Def,Var1) End If If opend<var2 Then 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