커뮤니티

문의

프로필 이미지
파일럿
2011-01-14 14:30:25
649
글번호 34977
답변완료
16822번 문의사항과 답변에 대한 질문입니다. 작성해 본 수식입니다.. 오류가 나오는데요 오류수정 부탁드리고요 시스템식을 합병하는 방법을 알려주시고요 합병하면 두가지 시스템에서 모두 신호가 나오는 건가요 if EntryPrice(0) >= EntryPrice(1) and close >= EntryPrice Then buy("매수",Atlimit, entryprice); if ExitPrice(1) >= EntryPrice(2) and close >= exitPrice(1) Then buy("매수",Atlimit, ExitPrice(1)); if EntryPrice(0) < EntryPrice(1) and close < EntryPrice Then exitlong("매도",Atlimit, entryprice); if ExitPrice(1) < EntryPrice(2) and close < exitPrice(1) Then ExitLong("매도",Atlimit, ExitPrice(1));
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2011-01-14 15:55:43

안녕하세요 예스스탁입니다. 검증상 오류가 발생하는 이유는 동일한 이름이 있기 때문입니다. 주문함수는 모두 다른 이름을 사용하셔야 합니다. if EntryPrice(0) >= EntryPrice(1) and close >= EntryPrice Then buy("매수1",Atlimit, entryprice); if ExitPrice(1) >= EntryPrice(2) and close >= exitPrice(1) Then buy("매수2",Atlimit, ExitPrice(1)); if EntryPrice(0) < EntryPrice(1) and close < EntryPrice Then exitlong("매도1",Atlimit, entryprice); if ExitPrice(1) < EntryPrice(2) and close < exitPrice(1) Then ExitLong("매도2",Atlimit, ExitPrice(1)); 문의하신 내용을 이해하지 못했습니다. 작성하신 내용 또한 매수1과 매도1의 EntryPrice(0) >= EntryPrice(1)와 같은 조건이 어떤것을 의미하시는 지 모르겠습니다. 가령 현재 무포지션에서 진입이되면 현재는 진입이 되어 있지 않으므로 entryprice는 0입니다. entryprice는 진입전에는 0이고 진입후에만 그값을 리턴받습니다. 그러므로 if EntryPrice(0) >= EntryPrice(1) and close >= EntryPrice Then buy("매수1",Atlimit, entryprice); if EntryPrice(0) < EntryPrice(1) and close < EntryPrice Then exitlong("매도1",Atlimit, entryprice); 위와 같은 식은 if 0 >= EntryPrice(1) and close >= 0 Then buy("매수1",Atlimit, entryprice); if 0 < EntryPrice(1) and close < 0 Then exitlong("매도1",Atlimit, entryprice); 와 같은 내용이 됩니다. 도한 A라는 식과 B라는 식을 합성해도 2개가 모두 신호가 발생하지 않습니다. 일반적으로 피라미딩을 하는 내용으로 작성하지 않는한 먼저 만족한 식 하나만 발동하게 됩니다. 즐거운 하루되세요 > 파일럿 님이 쓴 글입니다. > 제목 : 문의 > 16822번 문의사항과 답변에 대한 질문입니다. 작성해 본 수식입니다.. 오류가 나오는데요 오류수정 부탁드리고요 시스템식을 합병하는 방법을 알려주시고요 합병하면 두가지 시스템에서 모두 신호가 나오는 건가요 if EntryPrice(0) >= EntryPrice(1) and close >= EntryPrice Then buy("매수",Atlimit, entryprice); if ExitPrice(1) >= EntryPrice(2) and close >= exitPrice(1) Then buy("매수",Atlimit, ExitPrice(1)); if EntryPrice(0) < EntryPrice(1) and close < EntryPrice Then exitlong("매도",Atlimit, entryprice); if ExitPrice(1) < EntryPrice(2) and close < exitPrice(1) Then ExitLong("매도",Atlimit, ExitPrice(1));