커뮤니티

수식확인후 수정좀 부탁드립니다.

프로필 이미지
알러뷰
2015-10-06 08:12:54
146
글번호 90928
답변완료
아래 수식에서 매수진입후 매수청산은 정상적인거 같은데 매도진입후 1차 매도익절신호는 정상동작하는데 신호에 의해서 자동청산이 되어버립니다. 매도2계약 진입후에도 매도익절신호에 의해서 청산될수 있도록 해주시고요. 아래수식 확인후 수정좀 부탁드립니다. input : 진입계약수(2); var1 = ma(c,5); var2 = ma(c,20); if stime >= 90100 or stime < 033000 then{ if MarketPosition <= 0 and crossup(var1,var2) Then buy("b",OnClose,def,진입계약수); if MarketPosition >= 0 and CrossDown(var1,var2) Then sell("s",OnClose,def,진입계약수); if MarketPosition == 1 Then{ ExitLong("bx1",atlimit,EntryPrice+PriceScale*20,"",1,1); } if MarketPosition == -1 Then{ ExitShort("sx1",atlimit,EntryPrice-PriceScale*20,"",1,1); } } #지정시간 일괄청산 if stime == 033000 or (stime > 033000 and stime[1] < 033000) Then{ exitlong(); ExitShort(); }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-10-05 15:12:35

안녕하세요 예스스탁입니다. 식을 수정했습니다. input : 진입계약수(2); var1 = ma(c,5); var2 = ma(c,20); if stime >= 90100 or stime < 033000 then{ if MarketPosition <= 0 and crossup(var1,var2) Then buy("b",OnClose,def,진입계약수); if MarketPosition >= 0 and CrossDown(var1,var2) Then sell("s",OnClose,def,진입계약수); if MarketPosition == 1 Then{ ExitLong("bx1",atlimit,EntryPrice+PriceScale*20,"",1,1); ExitLong("bx2",atlimit,EntryPrice+PriceScale*30,"",1,1); ExitLong("bL",AtStop,EntryPrice-PriceScale*30); } if MarketPosition == -1 Then{ ExitShort("sx1",atlimit,EntryPrice-PriceScale*20,"",1,1); ExitShort("sx2",atlimit,EntryPrice-PriceScale*30,"",1,1); ExitShort("sl",AtStop,EntryPrice+PriceScale*30); } } #지정시간 일괄청산 if stime == 033000 or (stime > 033000 and stime[1] < 033000) Then{ exitlong(); ExitShort(); } 즐거운 하루되세요 > 알러뷰 님이 쓴 글입니다. > 제목 : 수식확인후 수정좀 부탁드립니다. > 위의그림의 "거래내역" 분석내용을 참조하셔서 아래 수식에서 매수진입후 매수청산은 정상적인거 같은데 매도진입후 1차 매도익절신호는 정상동작하는데 2차매도익절신호가 강제청산신호 "sl"신호에 의해서 자동청산이 되어버립니다. 매도2계약 진입후에도 "sx1" 매도익절신호와 "sx2" 매도익절신호에 의해서 청산될수 있도록 해주시고요. 매수진입이든 매도진입이든 남은 나머지 수량이 30틱이상 손실 발생시 무조건 강제청산 되도록 해주세요. 아래는 현재 거래내역에서 나오는 매수/매도 일괄청산신호명입니다. 매수일괄청산신호(= ExitLong_#1 또는 ExitLongNo1 ) 와 매도일괄청산신호(= ExitShort_#0 또는 ExitShortNo1 ) 아래수식 확인후 수정좀 부탁드립니다. input : 진입계약수(2); var1 = ma(c,5); var2 = ma(c,20); if stime >= 90100 or stime < 033000 then{ if MarketPosition <= 0 and crossup(var1,var2) Then buy("b",OnClose,def,진입계약수); if MarketPosition >= 0 and CrossDown(var1,var2) Then sell("s",OnClose,def,진입계약수); if MarketPosition == 1 Then{ ExitLong("bx1",atlimit,EntryPrice+PriceScale*20,"",1,1); ExitLong("bx2",atlimit,EntryPrice+PriceScale*30,"",1,1); ExitLong("bL",AtStop,EntryPrice-PriceScale*30,"",1,1); } if MarketPosition == -1 Then{ ExitShort("sx1",atlimit,EntryPrice-PriceScale*20,"",1,1); ExitShort("sx2",atlimit,EntryPrice-PriceScale*30,"",1,1); ExitShort("sl",atlimit,EntryPrice+PriceScale*30,"",1,1); } } #지정시간 일괄청산 if stime == 033000 or (stime > 033000 and stime[1] < 033000) Then{ exitlong(); ExitShort(); }