커뮤니티

150000시 청산을 하려합니다

프로필 이미지
훈sys
2014-04-13 16:07:21
162
글번호 74391
답변완료
연구원님께서 알려주신 블로그에 나온 식을 그대로 적용하여 30분봉 기준으로 15시00분에 "end1","end2"라는 이름으로 청산되도록 수식을 작성했는데 시뮬레이션을 해보면 다음날 첫봉에 청산됩니다. 어디가 잘못된건지 문의드립니다. input : buylen(0.37), atrlen(10), exlen(2.7); var1=dayhigh(1)-daylow(1); var : currententrynum(0); condition1=date==exitdate(1) and marketposition(1)==1; condition2=date==exitdate(1) and marketposition(1)==-1; if stime<150000 then { if condition1==false and marketposition<>1 then buy("buy",atstop,dayopen+var1*buylen); if condition2==false and marketposition<>-1 Then sell("sell",atstop,dayopen-var1*buylen); } if marketposition<>0 then { exitlong("ts_lg",atstop,highest(h,barssinceentry+1)-atr(atrlen)*exlen); exitshort("ts_st",atstop,lowest(l,barssinceentry+1)+atr(atrlen)*exlen); } if stime==150000 then { exitlong("end1",atmarket); exitshort("end2",atmarket); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2014-04-14 13:25:56

안녕하세요 예스스탁입니다. 30분봉 기준으로 15시 봉은 그날 마지막봉입니다. 청산의 타입이 Atmarket이므로 15시봉 다음봉시가에 청산신호가 표시됩니다. 아래와 같이 14시 30분봉 완성시에 15시봉 시가에 청산신호가 표시되도록 변경하셔야 합니다. input : buylen(0.37), atrlen(10), exlen(2.7); var1=dayhigh(1)-daylow(1); var : currententrynum(0); condition1=date==exitdate(1) and marketposition(1)==1; condition2=date==exitdate(1) and marketposition(1)==-1; if stime<150000 then { if condition1==false and marketposition<>1 then buy("buy",atstop,dayopen+var1*buylen); if condition2==false and marketposition<>-1 Then sell("sell",atstop,dayopen-var1*buylen); } if marketposition<>0 then { exitlong("ts_lg",atstop,highest(h,barssinceentry+1)-atr(atrlen)*exlen); exitshort("ts_st",atstop,lowest(l,barssinceentry+1)+atr(atrlen)*exlen); } if stime==143000 then { exitlong("end1",atmarket); exitshort("end2",atmarket); } 즐거운 하루되세요 > 훈sys 님이 쓴 글입니다. > 제목 : 150000시 청산을 하려합니다 > 연구원님께서 알려주신 블로그에 나온 식을 그대로 적용하여 30분봉 기준으로 15시00분에 "end1","end2"라는 이름으로 청산되도록 수식을 작성했는데 시뮬레이션을 해보면 다음날 첫봉에 청산됩니다. 어디가 잘못된건지 문의드립니다. input : buylen(0.37), atrlen(10), exlen(2.7); var1=dayhigh(1)-daylow(1); var : currententrynum(0); condition1=date==exitdate(1) and marketposition(1)==1; condition2=date==exitdate(1) and marketposition(1)==-1; if stime<150000 then { if condition1==false and marketposition<>1 then buy("buy",atstop,dayopen+var1*buylen); if condition2==false and marketposition<>-1 Then sell("sell",atstop,dayopen-var1*buylen); } if marketposition<>0 then { exitlong("ts_lg",atstop,highest(h,barssinceentry+1)-atr(atrlen)*exlen); exitshort("ts_st",atstop,lowest(l,barssinceentry+1)+atr(atrlen)*exlen); } if stime==150000 then { exitlong("end1",atmarket); exitshort("end2",atmarket); }