커뮤니티
시스템 식 일부 미작동 문의
2004-09-05 18:47:59
961
글번호 5030
<2385> 번 문의 사항의 연속입니다.
만들어 주신 시스템 식의 일부분이 작동되지 않는데
점검 부탁 드립니다.
(내용 : 첨부 문서)
- 1. 5126_시스템트레이딩-문의.doc (0.03 MB)
답변 1
예스스탁 예스스탁 답변
2004-09-06 10:54:25
안녕하세요
예스스탁입니다.
죄송합니다.
우선 and는 or로 바꾸는게 맞습니다.
밑의 두식은 같은 식입니다.
청산 신호를 확인하기 위해서 각 청산식을 두개로 나누어
으름을 붙여 봤습니다.
확인하시기 바랍니다.
식1==========================================================================
var : 정배열(0), 역배열(0), 상승(0), 하락(0), buyval(0),buyindex(0), sellval(0), sellindex(0);
정배열 = ma(c,5) > ma(c,10) and ma(c,10) > ma(c,20) and
ma(c,20) > ma(c,30) and ma(c,30) > ma(c,60);
역배열 = ma(c,5) < ma(c,10) and ma(c,10) < ma(c,20) and
ma(c,20) < ma(c,30) and ma(c,30) < ma(c,60);
상승 = ma(c,5) > ma(c,5)[1] and ma(c,10) > ma(c,10)[1] and ma(c,20) > ma(c,20)[1] and
ma(c,30) > ma(c,30)[1] and ma(c,60) > ma(c,60)[1];
하락 = ma(c,5) < ma(c,5)[1] and ma(c,10) < ma(c,10)[1] and ma(c,20) < ma(c,20)[1] and
ma(c,30) < ma(c,30)[1] and ma(c,60) < ma(c,60)[1];
if 정배열 and 상승 and c > ma(c,5) and
v > (NthHighest(1,V,dayindex()+1) + NthHighest(2,V,dayindex()+1) + NthHighest(3,V,dayindex()+1))/3 then{
buy();
buyval = c;
buyindex = index;
}
if index > buyindex and accumN(iff(c <= buyval,1,0),index-buyindex) >=3 or C < ma(c,5) then{
exitlong();
}
if 역배열 and 하락 and c < ma(c,5) and
v > (NthHighest(1,V,dayindex()+1) + NthHighest(2,V,dayindex()+1) + NthHighest(3,V,dayindex()+1))/3 then{
sell();
sellval = c;
sellindex = index;
}
if index > sellindex and accumN(iff(c >= sellval,1,0),index-sellindex) >=3 or C > ma(c,5) then{
exitshort();
}
식2==============================================================================
var : 정배열(0), 역배열(0), 상승(0), 하락(0), buyval(0),buyindex(0), sellval(0), sellindex(0);
정배열 = ma(c,5) > ma(c,10) and ma(c,10) > ma(c,20) and
ma(c,20) > ma(c,30) and ma(c,30) > ma(c,60);
역배열 = ma(c,5) < ma(c,10) and ma(c,10) < ma(c,20) and
ma(c,20) < ma(c,30) and ma(c,30) < ma(c,60);
상승 = ma(c,5) > ma(c,5)[1] and ma(c,10) > ma(c,10)[1] and ma(c,20) > ma(c,20)[1] and
ma(c,30) > ma(c,30)[1] and ma(c,60) > ma(c,60)[1];
하락 = ma(c,5) < ma(c,5)[1] and ma(c,10) < ma(c,10)[1] and ma(c,20) < ma(c,20)[1] and
ma(c,30) < ma(c,30)[1] and ma(c,60) < ma(c,60)[1];
if 정배열 and 상승 and c > ma(c,5) and
v > (NthHighest(1,V,dayindex()+1) + NthHighest(2,V,dayindex()+1) + NthHighest(3,V,dayindex()+1))/3 then{
buy("매수");
buyval = c;
buyindex = index;
}
if index > buyindex and accumN(iff(c <= buyval,1,0),index-buyindex) >=3 then{
exitlong("long1");
}
if C < ma(c,5) then{
exitlong("long2");
}
if 역배열 and 하락 and c < ma(c,5) and
v > (NthHighest(1,V,dayindex()+1) + NthHighest(2,V,dayindex()+1) + NthHighest(3,V,dayindex()+1))/3 then{
sell("매도");
sellval = c;
sellindex = index;
}
if index > sellindex and accumN(iff(c >= sellval,1,0),index-sellindex) >=3 then{
exitshort("short1");
}
if C > ma(c,5) then{
exitshort("short2");
}
즐거운 하루되세요
> pinetree 님이 쓴 글입니다.
> 제목 : 시스템 식 일부 미작동 문의
>
<2385> 번 문의 사항의 연속입니다.
만들어 주신 시스템 식의 일부분이 작동되지 않는데
점검 부탁 드립니다.
(내용 : 첨부 문서)