커뮤니티

로직 변환부탁.^

프로필 이미지
송사범
2008-04-30 10:28:51
1258
글번호 15415
답변완료
다음은 사이보스트레이더로 작성된 로직입니다. 이를 예스트레이더로 변환 부탁드립니다. 그리고, 아래 로직에 대한 각 줄마다 세부적인 해설을 좀 부탁합니다. 특히, var변수에 대입하는 부분들에 대해서 아직 실력이 떨어져서 해석이 되지 않네요.^ ---------------------------------------------------------------------------------- len1:25, len2:6, s1:0.37, s2:2.7, level:50 Var1=slowk(len1,len2) If tdate<>tdate(1) Then Var10=9999999 Var11=0 Var50=currententrynum Cond1=False Cond2=False End If If crossup(Var1,level) Then Var10=high End If If crossdn(Var1,level) Then Var11=low End If Cond1=crossup(Var1, level) Cond2=crossdn(Var1, level) If currententrynum-var50=0 Then If ttime<1500 Then If opend< closed(1) Then Call buy("매수",Atstop,Def,Var10) End If If opend> closed(1) Then Call sell("매도", Atstop,Def,Var11) End If If Var1>level Then Call buy("매수1",Atstop,Def,opend+(highd(1)-lowd(1))*s1) End If If Var1<level Then Call sell("매도1",Atstop,Def,opend-(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 If Cond2 Then Call exitlong("지표청산",Atstop,llv(1,low,3)) End If If Cond1 Then Call exitshort("지표청산",Atstop,hhv(1,high,3)) ----------------------------------------------------------------------------------
시스템
답변 3
프로필 이미지

예스스탁 예스스탁 답변

2008-04-30 11:33:57

안녕하세요 예스스탁입니다. input : len1(25), len2(6), s1(0.37), s2(2.7), level(50); var : cond1(false),cond2(false),currententrynum(0); Var1=slowk(len1,len2); If sdate<>sdate[1] Then{ Var10 = 9999999; Var11 = 0; Var50 = currententrynum; Cond1 = False; Cond2 = False; } if MarketPosition() == 0 Then currententrynum = TotalTrades(); Else currententrynum = TotalTrades()+1; If crossup(Var1,level) Then{ Var10=high; } If crossdown(Var1,level) Then{ Var11=low; } Cond1 = crossup(Var1, level); Cond2 = crossdown(Var1, level); If currententrynum - var50 == 0 Then { If stime<150000 Then{ If dayopen()< dayclose(1) Then{ buy("매수",Atstop,Var10); } If dayopen()> dayclose(1) Then { sell("매도", Atstop,Var11); } If Var1>level Then { buy("매수1",Atstop,dayopen()+(dayhigh(1)-lowd(1))*s1); } If Var1<level Then{ sell("매도1",Atstop,dayopen()-(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); } If Cond2 Then{ exitlong("지표청산1",Atstop,NthLowest(1,low,3)); } If Cond1 Then{ exitshort("지표청산2",Atstop,NthHighest(1,high,3)); } 즐거운 하루되세요 > 송사범 님이 쓴 글입니다. > 제목 : 로직 변환부탁.^ > 다음은 사이보스트레이더로 작성된 로직입니다. 이를 예스트레이더로 변환 부탁드립니다. 그리고, 아래 로직에 대한 각 줄마다 세부적인 해설을 좀 부탁합니다. 특히, var변수에 대입하는 부분들에 대해서 아직 실력이 떨어져서 해석이 되지 않네요.^ ---------------------------------------------------------------------------------- len1:25, len2:6, s1:0.37, s2:2.7, level:50 Var1=slowk(len1,len2) If tdate<>tdate(1) Then Var10=9999999 Var11=0 Var50=currententrynum Cond1=False Cond2=False End If If crossup(Var1,level) Then Var10=high End If If crossdn(Var1,level) Then Var11=low End If Cond1=crossup(Var1, level) Cond2=crossdn(Var1, level) If currententrynum-var50=0 Then If ttime<1500 Then If opend< closed(1) Then Call buy("매수",Atstop,Def,Var10) End If If opend> closed(1) Then Call sell("매도", Atstop,Def,Var11) End If If Var1>level Then Call buy("매수1",Atstop,Def,opend+(highd(1)-lowd(1))*s1) End If If Var1<level Then Call sell("매도1",Atstop,Def,opend-(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 If Cond2 Then Call exitlong("지표청산",Atstop,llv(1,low,3)) End If If Cond1 Then Call exitshort("지표청산",Atstop,hhv(1,high,3)) ----------------------------------------------------------------------------------
프로필 이미지

송사범

2008-04-30 12:03:22

로직 변환 고맙습니다.^ 그리고 더불어 각 행마다 구체적인 해설좀 부탁드립니다.
프로필 이미지

예스스탁 예스스탁 답변

2008-04-30 13:27:34

안녕하세요 예스스탁입니다. 설명을 붙여 드렸습니다. 즐거운 하루되세요 input : len1(25), len2(6), s1(0.37), s2(2.7), level(50); var : cond1(false),cond2(false),currententrynum(0); Var1=slowk(len1,len2);//스토케스틱 slow k If sdate<>sdate[1] Then{ //날짜가 변경될때 Var10 = 9999999; //var10은 9999999로 초기화 Var11 = 0; //var11은 0으로 초기화 Var50 = currententrynum; //var50에 전체 진입횟수 저장 Cond1 = False; //cond1은 false로 초기화 Cond2 = False; //cond2은 false로 초기화 } if MarketPosition() == 0 Then //무포지션 상태에서는 currententrynum = TotalTrades(); //청산종결된 모든 거래 횟수 저장 Else currententrynum = TotalTrades()+1;//포지션이 있는 상태에서는 청산종결된 모든 거래의 횟수에 +1 If crossup(Var1,level) Then{//슬로우K가 50 상향돌파할때 Var10=high; //var10에 고가 저장 } If crossdown(Var1,level) Then{//슬로우K가 50 하향이탈할때 Var11=low; //var11에 저자 저장 } Cond1 = crossup(Var1, level); //슬로우K가 50 상향돌파할때 cond1에 true 아니면 false Cond2 = crossdown(Var1, level); //슬로우K가 50 하향이탈할때 cond2에 true 아니면 false If currententrynum - var50 == 0 Then {// 현재진입횟수와 첫봉의 진입횟수가 같고(당일 첫진입을 나타내는 표현) If stime<150000 Then{ //15시 전이고 If dayopen()< dayclose(1) Then{ //당일시가가 전일종가보다 작으면 buy("매수",Atstop,Var10); //var10의 가격에 매수 } If dayopen()> dayclose(1) Then { //당일시가가 전일종가보다 크면 sell("매도", Atstop,Var11); //var11의 가격에 매도 } If Var1>level Then {//슬로우 K가 50보다 크면 buy("매수1",Atstop,dayopen()+(dayhigh(1)-lowd(1))*s1); //지정된 가격에 매수 } If Var1<level Then{ //글로우 K가 50보다 크면 sell("매도1",Atstop,dayopen()-(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);//지정된 가격이상의 시세가 들어오면 매도청산 } If Cond2 Then{ //cond2가 true 일때 exitlong("지표청산1",Atstop,NthLowest(1,low,3)); //지정된 가격에 매수청산 } If Cond1 Then{ //cond1이 true 일때 exitshort("지표청산2",Atstop,NthHighest(1,high,3)); //지정된 가격에 매도청산 } ## 지정된 가격은 각 주문함수의 atstop 뒤에 기입된 가격입니다. > 송사범 님이 쓴 글입니다. > 제목 : Re : Re : 로직 변환부탁.^ > 로직 변환 고맙습니다.^ 그리고 더불어 각 행마다 구체적인 해설좀 부탁드립니다.