커뮤니티

1988번 빠트리신 것 같아서..

프로필 이미지
회원
2004-06-23 10:10:15
1072
글번호 4202
답변완료
매수포지션후 매수청산 규칙에 의해 청산 했으나, 매수 청산 신호를 잘못된 신호로 간주하고 최근 10개봉의 최고가를 돌파하면 재진입하는 식을 만들고 싶습니다. 여기에 매수 청산후 15개 봉까지만 유효한 조건을 첨가하고 싶습니다. var:currentPosition(0), ReLEntrycount(0); currentPosition=MarketPosition(0); if CurrentPosition == 0 and CurrentPosition[1] == 1 then ReLEntrycount=1; if MarketPosition(0)==0 and MarketPosition(1)==1 and ReLEntryCount<15 then ReLEntrycount=ReLEntrycount + 1; if c>=highest(h, 10)[1] and ReLEntrycount < 10 then buy("재매수"); 논리적으로 오류가 없다고 생각하는데...실행시켜보면 재매수 신호가 매수청산이후 발생하는게 아니라 최초 신호로 발생하는 등의 오류가 있어서... 그럼 부탁 드립니다
기타
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2004-06-23 13:41:34

안녕하세요? 예스스탁입니다... 문의하신 식은 barssinceexit()을 이용하셔서 작성하실 수 있습니다.... if crossup(c, ma(c, 20)) then buy(); if crossup(c, highest(h, 10)[1]) and barssinceexit() < 15 then buy("재매수"); if crossdown(c, ma(c, 20)) then exitlong(); 감사합니다... > HH_bebored 님이 쓴 글입니다. > 제목 : 1988번 빠트리신 것 같아서.. > 매수포지션후 매수청산 규칙에 의해 청산 했으나, 매수 청산 신호를 잘못된 신호로 간주하고 최근 10개봉의 최고가를 돌파하면 재진입하는 식을 만들고 싶습니다. 여기에 매수 청산후 15개 봉까지만 유효한 조건을 첨가하고 싶습니다. var:currentPosition(0), ReLEntrycount(0); currentPosition=MarketPosition(0); if CurrentPosition == 0 and CurrentPosition[1] == 1 then ReLEntrycount=1; if MarketPosition(0)==0 and MarketPosition(1)==1 and ReLEntryCount<15 then ReLEntrycount=ReLEntrycount + 1; if c>=highest(h, 10)[1] and ReLEntrycount < 10 then buy("재매수"); 논리적으로 오류가 없다고 생각하는데...실행시켜보면 재매수 신호가 매수청산이후 발생하는게 아니라 최초 신호로 발생하는 등의 오류가 있어서... 그럼 부탁 드립니다