커뮤니티

수식작성 부탁드립니다.

프로필 이미지
고민중
2024-02-20 21:45:49
1079
글번호 176815
답변완료
대신증권cybos언어로 구현된 것인데 예스랭귀지로 변환하고 싶습니다. 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
프로필 이미지

예스스탁 예스스탁 답변

2024-02-21 13:36:33

안녕하세요 예스스탁입니다. Input: len(3.2), len1(0.34); var : cond1(False),cond2(False); If opend(0)>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); } Else if opend(0)<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); } 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 opend(0)>var1 Then { buy("매수1",Atstop,opend(0)+(Var1-var2)*len1); } If opend(0)<var2 Then { buy("매수4",Atstop,Var2); } } If Cond2==False Then { If opend(0)>var1 Then { sell("매도1",Atstop,Var1); } If opend(0)<var2 Then { sell("매도4",Atstop,opend(0)-(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); } 즐거운 하루되세요 > 고민중 님이 쓴 글입니다. > 제목 : 수식작성 부탁드립니다. > 대신증권cybos언어로 구현된 것인데 예스랭귀지로 변환하고 싶습니다. 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