커뮤니티
변환부탁드립니다...
2011-03-01 14:27:33
627
글번호 36164
안녕하세요..
ct인데...yt변환부탁드려요..
이거 미숙해서잘 안되네요...^-^..
input : Period(), P(), level(), ob1(), os1(), ob2(),
os2(), s2(), s3(), s4();
Var1=fastk(len1)
Var2=fastk(len2)
Cond1=var1>ob1 And Var2>ob2
Cond2=var1<os1 And Var2<os2
Cond50= tdate=exitdate(1) And position(1)=1
Cond49= tdate=exitdate(1) And position(1)=-1
If ttime<1500 Then
If Cond50=False Then
If Cond1 Then
If opend<close Then
Call buy("매수",Atstop,Def,high+Atr(s4)*level)
End If
End If
End If
If Cond49=False Then
If Cond2 Then
If opend>close Then
Call sell("매도",Atstop,Def,low-Atr(s4)*level)
End If
End If
End If
End If
If position<>0 Then
Call exitlong("청산1",Atstop,hhv(1,high,barnumsinceentry+1)-atr(s3)*s2)
Call exitshort("청산2",Atstop,llv(1,low,barnumsinceentry+1)+atr(s3)*S2)
End If
답변 1
예스스탁 예스스탁 답변
2011-03-02 11:05:26
안녕하세요
예스스탁입니다.
문법검증을 위해 비어있거나 빠진 외부변수는 모두 1로 처리했습니다.
input : Period(1), P(1), level(1), ob1(1), os1(1), ob2(1),os2(1), s2(1), s3(1), s4(1),len1(1),len2(1);
var : cond1(false),cond2(false),cond49(false),cond50(false);
Var1=fastk(len1);
Var2=fastk(len2);
Cond1=var1>ob1 And Var2>ob2;
Cond2=var1<os1 And Var2<os2;
Cond50= sdate==exitdate(1) And MarketPosition(1)==1;
Cond49= sdate==exitdate(1) And MarketPosition(1)==-1;
If stime<150000 Then{
If Cond50==False Then{
If Cond1 Then{
If DayOpen<close Then{
buy("매수",Atstop,high+Atr(s4)*level);
}
}
}
If Cond49==False Then{
If Cond2 Then{
If dayopen>close Then{
sell("매도",Atstop,low-Atr(s4)*level) ;
}
}
}
}
If MarketPosition<>0 Then{
exitlong("청산1",Atstop,highest(high,BarsSinceEntry+1)-atr(s3)*s2);
exitshort("청산2",Atstop,Lowest(low,BarsSinceEntry+1)+atr(s3)*S2) ;
}
즐거운 하루되세요
> 아이리스 님이 쓴 글입니다.
> 제목 : 변환부탁드립니다...
> 안녕하세요..
ct인데...yt변환부탁드려요..
이거 미숙해서잘 안되네요...^-^..
input : Period(), P(), level(), ob1(), os1(), ob2(),
os2(), s2(), s3(), s4();
Var1=fastk(len1)
Var2=fastk(len2)
Cond1=var1>ob1 And Var2>ob2
Cond2=var1<os1 And Var2<os2
Cond50= tdate=exitdate(1) And position(1)=1
Cond49= tdate=exitdate(1) And position(1)=-1
If ttime<1500 Then
If Cond50=False Then
If Cond1 Then
If opend<close Then
Call buy("매수",Atstop,Def,high+Atr(s4)*level)
End If
End If
End If
If Cond49=False Then
If Cond2 Then
If opend>close Then
Call sell("매도",Atstop,Def,low-Atr(s4)*level)
End If
End If
End If
End If
If position<>0 Then
Call exitlong("청산1",Atstop,hhv(1,high,barnumsinceentry+1)-atr(s3)*s2)
Call exitshort("청산2",Atstop,llv(1,low,barnumsinceentry+1)+atr(s3)*S2)
End If
다음글