커뮤니티
분봉에서 일봉값 적용시
2006-09-08 15:54:08
1019
글번호 10791
시스템식 문의 입니다.
분봉에서. 전일종가는 전일20일이평선보다 크고 2일전 종가는 2일전 20일이평선보다 크고 양봉일때 매수 반대일 경우는 매도인 시스템식 작성햇는데. 결과가 제대로안나오네요..
if dayclose(1)>ma(dayclose(),20)[1] and dayclose(2)<ma(dayclose(),20)[2] and o<c then
buy();
if dayclose(1)<ma(dayclose(),20)[1] and dayclose(2)>ma(dayclose(),20)[2] and o>c then
sell();
어디가 잘못된건가요.
답변 1
예스스탁 예스스탁 답변
2006-09-12 08:40:49
안녕하세요
예스스탁입니다.
문의하신 식은 다음과 같습니다.
input: P1(20);
var : sumV1(0),sumV2(0),maV1(0),maV2(0),cnt1(0), cnt2(0);
sumV1 = 0;
for cnt1 = 1 to P1 {
sumV1 = sumV1+DayClose(cnt1);
}
sumV2 = 0;
for cnt2 = 2 to P1+1 {
sumV2 = sumV2+DayClose(cnt2);
}
maV1 = sumV1 / P1;
maV2 = sumV2 / P1;
if dayclose(1) > maV1 and dayclose(2) < mav2 and O < c then
buy();
if dayclose(1)< maV1 and dayclose(2) > maV2 and o>c then
sell();
참고하시기 바랍니다.
즐거운 하루되세요
> 진짜멋진놈 님이 쓴 글입니다.
> 제목 : 분봉에서 일봉값 적용시
> 시스템식 문의 입니다.
분봉에서. 전일종가는 전일20일이평선보다 크고 2일전 종가는 2일전 20일이평선보다 크고 양봉일때 매수 반대일 경우는 매도인 시스템식 작성햇는데. 결과가 제대로안나오네요..
if dayclose(1)>ma(dayclose(),20)[1] and dayclose(2)<ma(dayclose(),20)[2] and o<c then
buy();
if dayclose(1)<ma(dayclose(),20)[1] and dayclose(2)>ma(dayclose(),20)[2] and o>c then
sell();
어디가 잘못된건가요.
다음글