커뮤니티
수식변환부탁드립니다.
2008-09-11 11:50:42
849
글번호 16995
안녕하세요.
번거로우시더라도 수식변환부탁드립니다.
len1, len2, x, y 를 다양하게해서 테스트해보고 싶습니다.
Var1 = hhv(1,close,len1,1) 'len1(5)일 동안 가장 높은 종가
Var2 = llv(1,close,len2,1) 'len1(5)일 동안 가장 낮은 종가
'지난 5일간의 종가를 기준으로 가장 높은 종가 상향돌파시 매수
If crossup(close,Var1) Then
Call buy("5봉-매수",Onclose)
End If
'지난 5일간의 종가를 기준으로 가장 낮은 종가를 하향돌파시 매수청산
If crossdn(close,Var2) Then
Call exitlong("5봉-매수청산",Onclose)
End If
If ttime>=1201 And ttime<=1431 Then
End If
'투자원금대비 x%이익이 낫다가 이익이 y%이상 감소했을때(매수시)
If position = 1 Then
If entryprice*(1+0.01*x)<=hhv(1,high,barnumsinceentry+1) Then
Call exitlong("매수이익청산",Atstop,entryprice+(hhv(1,high,barnumsinceentry+1)-entryprice)*(1-0.01*y))
End If
End If
감사합니다.
즐거운 명절되세요...
답변 1
예스스탁 예스스탁 답변
2008-09-11 13:08:36
안녕하세요
예스스탁입니다.
input : len1(5),len2(5),X(1),Y(1);
Var1 = highest(close,len1)[1];//'len1(5)일 동안 가장 높은 종가
Var2 = Lowest(close,len2)[1]; //'len1(5)일 동안 가장 낮은 종가
//'지난 5일간의 종가를 기준으로 가장 높은 종가 상향돌파시 매수
If crossup(close,Var1) Then{
buy("5봉-매수",Onclose);
}
//'지난 5일간의 종가를 기준으로 가장 낮은 종가를 하향돌파시 매수청산
If CrossDown(close,Var2) Then{
exitlong("5봉-매수청산",Onclose);
}
If time >= 120100 And Time<=143100 Then{
}
//'투자원금대비 x%이익이 낫다가 이익이 y%이상 감소했을때(매수시)
If MarketPosition() == 1 Then{
If entryprice*(1+0.01*x)<= highest(high,BarsSinceEntry()+1) Then{
exitlong("매수이익청산",Atstop,entryprice+(Highest(high,BarsSinceEntry()+1)-entryprice)*(1-0.01*y));
}
}
즐거운 한가위 되시길 바랍니다.
> 아로마 님이 쓴 글입니다.
> 제목 : 수식변환부탁드립니다.
> 안녕하세요.
번거로우시더라도 수식변환부탁드립니다.
len1, len2, x, y 를 다양하게해서 테스트해보고 싶습니다.
Var1 = hhv(1,close,len1,1) 'len1(5)일 동안 가장 높은 종가
Var2 = llv(1,close,len2,1) 'len1(5)일 동안 가장 낮은 종가
'지난 5일간의 종가를 기준으로 가장 높은 종가 상향돌파시 매수
If crossup(close,Var1) Then
Call buy("5봉-매수",Onclose)
End If
'지난 5일간의 종가를 기준으로 가장 낮은 종가를 하향돌파시 매수청산
If crossdn(close,Var2) Then
Call exitlong("5봉-매수청산",Onclose)
End If
If ttime>=1201 And ttime<=1431 Then
End If
'투자원금대비 x%이익이 낫다가 이익이 y%이상 감소했을때(매수시)
If position = 1 Then
If entryprice*(1+0.01*x)<=hhv(1,high,barnumsinceentry+1) Then
Call exitlong("매수이익청산",Atstop,entryprice+(hhv(1,high,barnumsinceentry+1)-entryprice)*(1-0.01*y))
End If
End If
감사합니다.
즐거운 명절되세요...
다음글
이전글