커뮤니티
변환요청
2009-08-24 14:22:16
860
글번호 24381
예스트레이더에 맞게 변환 요청합니다.
settestmode
Var50=mov(close,len,S)
Var49=mov(close,len,S)
'그물망 설정
For i = 1 To cont
If Var50<mov(close,len+stepp*i,S) Then
Var50=mov(close,len+stepp*i,S) '그물망중 상단부 결정
End If
If Var49>mov(close,len+stepp*i,S) Then
Var49=mov(close,len+stepp*i,S) '그물망중 하단부 결정
End If
Next
Var1=var50-var49 '그물망 상하단 차이
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
'기간중 최고 var10이 1이고 기간중 최고 var10이 나온봉이 delay-1봉전이라면
If hhv(1,Var10,delay)=1 And hhb(1,Var10,delay)=delay-1 Then
If ttime<1500 Then
If Cond1=False Then
Call buy("매수",Atstop,Def,opend+(highd(1)-lowd(1))*s1) '지정가 상향돌파시 매수
End If
If Cond2=False Then
Call sell("매도",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)
답변 1
예스스탁 예스스탁 답변
2009-08-24 16:31:41
안녕하세요
예스스탁입니다.
input : len(1),cont(1),stepp(1),multi(1),delay(1),s1(1),s2(1);
var : ii(0),Cond1(false),cond2(false);
Var50=ma(close,len);
Var49=ma(close,len);
#'그물망 설정
For ii = 1 To cont{
If Var50 < ma(close,len+stepp*ii) Then
Var50=ma(close,len+stepp*ii); #그물망중 상단부 결정
If Var49 > ma(close,len+stepp*ii) Then
Var49=Ma(close,len+stepp*ii); #'그물망중 하단부 결정
}
Var1=var50-var49; # '그물망 상하단 차이
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;
#'기간중 최고 var10이 1이고 기간중 최고 var10이 나온봉이 delay-1봉전이라면
If NthHighest(1,Var10,delay)==1 And NthHighestBar(1,Var10,delay)== delay-1 Then{
If stime<150000 Then{
If Cond1==False Then{
buy("매수",Atstop,dayopen+(dayhigh(1)-daylow(1))*s1); # '지정가 상향돌파시 매수
}
If Cond2==False Then{
sell("매도",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);
}
즐거운 하루되세요
> HI_coco 님이 쓴 글입니다.
> 제목 : 변환요청
> 예스트레이더에 맞게 변환 요청합니다.
settestmode
Var50=mov(close,len,S)
Var49=mov(close,len,S)
'그물망 설정
For i = 1 To cont
If Var50<mov(close,len+stepp*i,S) Then
Var50=mov(close,len+stepp*i,S) '그물망중 상단부 결정
End If
If Var49>mov(close,len+stepp*i,S) Then
Var49=mov(close,len+stepp*i,S) '그물망중 하단부 결정
End If
Next
Var1=var50-var49 '그물망 상하단 차이
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
'기간중 최고 var10이 1이고 기간중 최고 var10이 나온봉이 delay-1봉전이라면
If hhv(1,Var10,delay)=1 And hhb(1,Var10,delay)=delay-1 Then
If ttime<1500 Then
If Cond1=False Then
Call buy("매수",Atstop,Def,opend+(highd(1)-lowd(1))*s1) '지정가 상향돌파시 매수
End If
If Cond2=False Then
Call sell("매도",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)
다음글
이전글