커뮤니티
barssinceentry에서 매수봉 위치가 다른 것.
2009-11-17 12:47:02
820
글번호 26198
안녕하세요.
매수 신호가 1번봉에서 나올 때 alimit를 써서 실제 진입은 2번봉 시가에 시작했습니다.
청산을 위해 아래와 같이 작성했는데, highest(h, barssinceentry)가 적용되는 시점은 3번 봉 부터더군요. 진입을 했던 2번 봉부터 고가가 체크되도록 할 수는 없는지요?
예제>
if marketposition()==0 && stime>=090000 && c > dayopen()+(dayhigh(1)-daylow(1))*0.3 then buy("B", atlimit, c);
if marketposition()==1 && c < highest(h, barssinceentry)-(atr(20)*3) then exitlong("Bx", atlimit, c);
답변 1
예스스탁 예스스탁 답변
2009-11-17 13:55:43
안녕하세요
예스스탁입니다.
highest(h, barssinceentry) 진입봉 이후부터의 최고가
highest(h, barssinceentry+1) 진입봉을 부함한 진입이후의 최고가입니다.
if marketposition()==1 && c < highest(h, barssinceentry+1)-(atr(20)*3) then exitlong("Bx", atlimit, c);
즐거운 하루되세요
> kekino 님이 쓴 글입니다.
> 제목 : barssinceentry에서 매수봉 위치가 다른 것.
> 안녕하세요.
매수 신호가 1번봉에서 나올 때 alimit를 써서 실제 진입은 2번봉 시가에 시작했습니다.
청산을 위해 아래와 같이 작성했는데, highest(h, barssinceentry)가 적용되는 시점은 3번 봉 부터더군요. 진입을 했던 2번 봉부터 고가가 체크되도록 할 수는 없는지요?
예제>
if marketposition()==0 && stime>=090000 && c > dayopen()+(dayhigh(1)-daylow(1))*0.3 then buy("B", atlimit, c);
if marketposition()==1 && c < highest(h, barssinceentry)-(atr(20)*3) then exitlong("Bx", atlimit, c);