커뮤니티

85057 관련 추가 질문입니다.

프로필 이미지
중박주식
2023-12-22 11:28:42
905
글번호 175134
답변완료
1. CurrentContracts의 경우 매도 진입 수량이 있는 경우 마이너스 값으로 표출이 되나요? 아니면 그냥 절대값인가요? 2. 만약 마이너스로 표출이 된다고하면, 지난번에 부탁드린 내용을 매도로 바꾸면 아래와 같이 변경하면 되는거겠죠? var : EP2(0); if MarketPosition == -1 Then { if CurrentContracts < CurrentContracts[1] Then EP2 = LatestEntryPrice(0)*(1+물타기/100); if CurrentContracts > CurrentContracts[1] and LatestExitName(0) == "StopProfitTarget" Then EP2 = LatestExitPrice(0)*1.01; if sTime < 153000 Then Buy("ss",AtLimit,EP2); } 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2023-12-22 11:49:17

안녕하세요 예스스탁입니다. CurrentContracts는 양수로만 리턴됩니다. CurrentContracts > CurrentContracts[1] 전봉대비 진입수량 증가이므로 진입이 발생한것을 의미합니다. CurrentContracts > CurrentContracts[1] 전봉대비 진입수량 하락이므로 청산이 발생한것을 의미합니다. 매수포지션 매도포지션 모두 동일 내용을 사용하시면 됩니다. var : EP(0); #매도포지션 구간 if MarketPosition == -1 Then { #최근 발생신호가 진입이면 if CurrentContracts > CurrentContracts[1] Then EP = LatestEntryPrice(0)*(1+물타기/100); #최근 발생신호가 청산이고 익절이었다면 if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "StopProfitTarget" Then EP = LatestExitPrice(0)*1.01; if sTime < 153000 Then Sell("SS",AtLimit,EP); } 즐거운 하루되세요 > 중박주식 님이 쓴 글입니다. > 제목 : 85057 관련 추가 질문입니다. > 1. CurrentContracts의 경우 매도 진입 수량이 있는 경우 마이너스 값으로 표출이 되나요? 아니면 그냥 절대값인가요? 2. 만약 마이너스로 표출이 된다고하면, 지난번에 부탁드린 내용을 매도로 바꾸면 아래와 같이 변경하면 되는거겠죠? var : EP2(0); if MarketPosition == -1 Then { if CurrentContracts < CurrentContracts[1] Then EP2 = LatestEntryPrice(0)*(1+물타기/100); if CurrentContracts > CurrentContracts[1] and LatestExitName(0) == "StopProfitTarget" Then EP2 = LatestExitPrice(0)*1.01; if sTime < 153000 Then Buy("ss",AtLimit,EP2); } 감사합니다.