커뮤니티

청산관련 문의

프로필 이미지
에이드
2020-07-11 04:18:01
2611
글번호 215939
답변완료
if MarketPosition == 1 then{ SetStopProfittarget(5,PointStop); } if MarketPosition == -1 then{ SetStopProfittarget(10,PointStop); } 전 거래가 매수or매도로서 수익일 경우 다음 거래가 반대 포지션을 계약 시 이전 계약 포지션의 청산포인트를 유지하는 버그가 있습니다. ex)매수+5 수익청산 -> 매도+5 수익청산 ex)매도+10 수익청산 -> 매수+10 수익청산
기타
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-07-13 11:49:40

안녕하세요 예스스탁입니다. if문은 봉완성에 조건만족여부를 체크합니다. 진입이 발생하고 한봉은 완성이 되어야 MarketPosition이 1이나 -1로 변경이 되고 포지션변경이 인식됩니다. 진입이 onclose인 경우 신호표시봉 다음다음봉부터 나머지 타입은 신호봉 다음봉 부터 설정이 적용됩니다. 그러므로 진입신호가 발생하면 그 다음봉에서 청산할 내용은 별도로 추가해 주셔야 합니다. 1 진입이 onclose인 경우 if MarketPosition != 1 then exitlong("bp",atlimit,C+5); if MarketPosition != -1 then exitshort("sp",atlimit,C-10); if MarketPosition == 1 then { SetStopProfittarget(5,PointStop); } else if MarketPosition == -1 then{ SetStopProfittarget(10,PointStop); } else SetStopProfittarget(0,PointStop); 2 진입이 atmarket인 경우 if MarketPosition != 1 then exitlong("bp",atlimit,NextBarOpen+5); if MarketPosition != -1 then exitshort("p",atlimit,NextBarOpen-10); if MarketPosition == 1 then { SetStopProfittarget(5,PointStop); } else if MarketPosition == -1 then{ SetStopProfittarget(10,PointStop); } else SetStopProfittarget(0,PointStop); 3 진입이 atstop이나 atlimit인 경우 진입의 atstop이나 atlimit뒤에 지정한 신호가격을 아래에 추가해 주셔야 합니다. if MarketPosition != 1 then exitlong("bp",atlimit,max(NextBarOpen,신호가격)+5); if MarketPosition != -1 then exitshort("sp",atlimit,min(NextBarOpen,신호가격)-10); if MarketPosition == 1 then { SetStopProfittarget(5,PointStop); } else if MarketPosition == -1 then{ SetStopProfittarget(10,PointStop); } else SetStopProfittarget(0,PointStop); 즐거운 하루되세요 > 에이드 님이 쓴 글입니다. > 제목 : 청산관련 문의 > if MarketPosition == 1 then{ SetStopProfittarget(5,PointStop); } if MarketPosition == -1 then{ SetStopProfittarget(10,PointStop); } 전 거래가 매수or매도로서 수익일 경우 다음 거래가 반대 포지션을 계약 시 이전 계약 포지션의 청산포인트를 유지하는 버그가 있습니다. ex)매수+5 수익청산 -> 매도+5 수익청산 ex)매도+10 수익청산 -> 매수+10 수익청산