커뮤니티
검토 좀 부탁드립니다
2008-10-31 13:46:06
774
글번호 17802
아주 단순한 로직입니다 돌파 매매 손절매있고 종가 청산 하루 진입 회수 2번 이하
그런데 막상 돌려보면 진입 하자마자 다음 봉에서 청산이 되네요
뭐가 문제일까 좀 부탁드립니다 ^^ ;;;;;
Inputs : d(0.15);
variables : range(0),upper(0),lower(0),Entrycount(0),count(0);
if sdate<> sdate[1] then
range=dayhigh(1)-daylow(1);
upper=dayopen()+range*d;
lower=dayopen()-range*d;
Entrycount=0;
for count=0 to 10
If Entrydate(count)==sdate then
Entrycount=Entrycount+1;
If Entrycount<2 then begin
if crossup(c,upper) then
buy();
if crossdown(c,lower) then
sell();
end ;
Setstoploss(2);
If marketposition()==1 and stime>1440 then
exitlong();
If marketposition()==-1 and stime>1440 then
exitshort();
답변 1
예스스탁 예스스탁 답변
2008-10-31 16:12:21
안녕하세요
예스스탁입니다.
청산식의 시간표현을 잘못하셨습니다.
예스랭귀지에서 시간은 HHMMSS로 총 6자리로 표현합니다.
14시 40분은 144000으로 표시하셔야 합니다.
즐거운 하루되세요
> psh1 님이 쓴 글입니다.
> 제목 : 검토 좀 부탁드립니다
> 아주 단순한 로직입니다 돌파 매매 손절매있고 종가 청산 하루 진입 회수 2번 이하
그런데 막상 돌려보면 진입 하자마자 다음 봉에서 청산이 되네요
뭐가 문제일까 좀 부탁드립니다 ^^ ;;;;;
Inputs : d(0.15);
variables : range(0),upper(0),lower(0),Entrycount(0),count(0);
if sdate<> sdate[1] then
range=dayhigh(1)-daylow(1);
upper=dayopen()+range*d;
lower=dayopen()-range*d;
Entrycount=0;
for count=0 to 10
If Entrydate(count)==sdate then
Entrycount=Entrycount+1;
If Entrycount<2 then begin
if crossup(c,upper) then
buy();
if crossdown(c,lower) then
sell();
end ;
Setstoploss(2);
If marketposition()==1 and stime>1440 then
exitlong();
If marketposition()==-1 and stime>1440 then
exitshort();
다음글
이전글