커뮤니티

조건부 진입

프로필 이미지
프랭크84
2013-04-23 23:56:14
185
글번호 62411
답변완료
<전략1> 장 시작 직후 첫 5분봉이 음봉이고 종가가 120ma이하면 선물매도 -> 120ma 상향 돌파시 청산 If dayindex==0 and C<O and c<ma(c,120) then sell(); if crossup(c,ma(c,120)) then Exitshort(); <전략2> 장중에 60 ma 하향시 선물매도 -> 60 ma 상향시 정산 If crossdown(c,ma(c,60) then sell(); if crossup(c,ma(c,60) then Exitshort(); 전략 1,2가 동일 계좌에 연결되어 있습니다. 계좌는 2000만원 밖에 없어서 1계약 밖에 매매할 수 없습니다. 전략1과 2가 동시에 만족되는 경우 정산에 문제가 있을 것 같아 전략2를 다음과 같이 수정했지만 원하는 결과를 얻을 수 없습니다. (전략2는 전략1이 만족되지 않았을 때만 실행) 어떻게 하면 되나요? If dayindex==0 and C<O and c<ma(c,120) then condition1=false;else condition1=true; If condition1=true and crossdown(c,ma(c,60) then sell(); if crossup(c,ma(c,60) then Exitshort();
검색
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-04-24 14:15:48

안녕하세요 예스스탁입니다. 전략2를 아래와 같이 작성하시면 됩니다. if dayindex == 0 Then Condition1 = false; If dayindex==0 and C<O and c<ma(c,120) then Condition1 = true; If Condition1 == false and crossdown(c,ma(c,60) then sell(); if crossup(c,ma(c,60) then Exitshort(); 즐거운 하루되세요 > 프랭크84 님이 쓴 글입니다. > 제목 : 조건부 진입 > <전략1> 장 시작 직후 첫 5분봉이 음봉이고 종가가 120ma이하면 선물매도 -> 120ma 상향 돌파시 청산 If dayindex==0 and C<O and c<ma(c,120) then sell(); if crossup(c,ma(c,120)) then Exitshort(); <전략2> 장중에 60 ma 하향시 선물매도 -> 60 ma 상향시 정산 If crossdown(c,ma(c,60) then sell(); if crossup(c,ma(c,60) then Exitshort(); 전략 1,2가 동일 계좌에 연결되어 있습니다. 계좌는 2000만원 밖에 없어서 1계약 밖에 매매할 수 없습니다. 전략1과 2가 동시에 만족되는 경우 정산에 문제가 있을 것 같아 전략2를 다음과 같이 수정했지만 원하는 결과를 얻을 수 없습니다. (전략2는 전략1이 만족되지 않았을 때만 실행) 어떻게 하면 되나요? If dayindex==0 and C<O and c<ma(c,120) then condition1=false;else condition1=true; If condition1=true and crossdown(c,ma(c,60) then sell(); if crossup(c,ma(c,60) then Exitshort();