커뮤니티

수식 문의 드립니다.

프로필 이미지
제이크
2016-07-04 23:10:00
143
글번호 99747
답변완료
안녕하세요. 만들어주신 시스템 로직의 도움을 받아 다양한 변수 조건에서 테스트를 하고 있습니다. 너무 감사합니다. 아래 작성해주신 조건을 바탕으로 강제 청산 조건을 하나 추가 하고 싶습니다. 로직에 따른 미청산이 있을 경우, "상품의 현재가가 20 이평"을 터치할 경우, 무조건 청산이라는 조건을 넣고 싶습니다. 늘 빠르고 훌륭한 로직으로 도와주셔서 감사합니다. #매수진입후 if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then var1 = H; if H > var1 Then var1 = H; #진입이 1번일경우 if MaxEntries == 1 Then{ #15틱 하락하면 1계약 추가매수진입 buy("bb",atlimit,EntryPrice-PriceScale*15,1); #진입가+10틱에 청산 ExitLong("bp1",Atlimit,EntryPrice+PriceScale*10); #4틱이상 상승후 진입가+2틱에 도달하면 매수청산 if var1 >= EntryPrice+PriceScale*4 Then exitlong("bx1",AtStop,EntryPrice+PriceScale*2); } #진입이 2번일 경우 if MaxEntries == 2 Then{ #청산이 아직 발생하지 않은 경우 평단가+4틱 수익이면 1계약청 if CurrentContracts == MaxContracts Then ExitLong("bp21",Atlimit,avgEntryPrice+PriceScale*4,"",1,1); #일부청산이 된 경우 if CurrentContracts < MaxContracts Then #평단가 +10틱이상이면 나머지 청산 ExitLong("bp22",Atlimit,AvgEntryPrice+PriceScale*10); #평단가 +4틱이상 상승후 하락해서 평단가+4틱에 도달하면 나머지 청산 if var1 > AvgEntryPrice+PriceScale*4 Then exitlong("bx2",AtStop,EntryPrice+PriceScale*4); } } #매도진입후 if MarketPosition == -1 Then{ if CurrentContracts > CurrentContracts[1] Then var2 = L; if L < var2 Then var2 = L; #진입이 1번일경우 if MaxEntries == 1 Then{ #15틱 상승하면 1계약 추가매도진입 sell("ss",atlimit,EntryPrice+PriceScale*15,1); #진입가-10틱에 청산 ExitShort("sp1",Atlimit,EntryPrice-PriceScale*10); #4틱 하락 후 진입가-2틱에 도달하면 매도청산 if var2 <= EntryPrice-PriceScale*4 Then ExitShort("sx1",AtStop,EntryPrice-PriceScale*2); } #진입이 2번일 경우 if MaxEntries == 2 Then{ if CurrentContracts == MaxContracts Then ExitShort("sp21",Atlimit,avgEntryPrice-PriceScale*4); if CurrentContracts < MaxContracts Then ExitShort("sp22",Atlimit,AvgEntryPrice-PriceScale*10); if var2 < AvgEntryPrice-PriceScale*4 Then ExitShort("sx2",AtStop,EntryPrice-PriceScale*4); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-07-05 12:50:54

안녕하세요 예스스탁입니다. input : P(20); var : mav(0); mav = ma(C,P); #매수진입후 if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then var1 = H; if H > var1 Then var1 = H; #진입이 1번일경우 if MaxEntries == 1 Then{ #15틱 하락하면 1계약 추가매수진입 buy("bb",atlimit,EntryPrice-PriceScale*15,1); #진입가+10틱에 청산 ExitLong("bp1",Atlimit,EntryPrice+PriceScale*10); #4틱이상 상승후 진입가+2틱에 도달하면 매수청산 if var1 >= EntryPrice+PriceScale*4 Then exitlong("bx1",AtStop,EntryPrice+PriceScale*2); } #진입이 2번일 경우 if MaxEntries == 2 Then{ #청산이 아직 발생하지 않은 경우 평단가+4틱 수익이면 1계약청 if CurrentContracts == MaxContracts Then ExitLong("bp21",Atlimit,avgEntryPrice+PriceScale*4,"",1,1); #일부청산이 된 경우 if CurrentContracts < MaxContracts Then #평단가 +10틱이상이면 나머지 청산 ExitLong("bp22",Atlimit,AvgEntryPrice+PriceScale*10); #평단가 +4틱이상 상승후 하락해서 평단가+4틱에 도달하면 나머지 청산 if var1 > AvgEntryPrice+PriceScale*4 Then exitlong("bx2",AtStop,EntryPrice+PriceScale*4); } if H < mav Then exitlong("bx21",AtLimit,mav); if L > mav Then exitlong("bx22",AtStop,mav); } #매도진입후 if MarketPosition == -1 Then{ if CurrentContracts > CurrentContracts[1] Then var2 = L; if L < var2 Then var2 = L; #진입이 1번일경우 if MaxEntries == 1 Then{ #15틱 상승하면 1계약 추가매도진입 sell("ss",atlimit,EntryPrice+PriceScale*15,1); #진입가-10틱에 청산 ExitShort("sp1",Atlimit,EntryPrice-PriceScale*10); #4틱 하락 후 진입가-2틱에 도달하면 매도청산 if var2 <= EntryPrice-PriceScale*4 Then ExitShort("sx1",AtStop,EntryPrice-PriceScale*2); } #진입이 2번일 경우 if MaxEntries == 2 Then{ if CurrentContracts == MaxContracts Then ExitShort("sp21",Atlimit,avgEntryPrice-PriceScale*4); if CurrentContracts < MaxContracts Then ExitShort("sp22",Atlimit,AvgEntryPrice-PriceScale*10); if var2 < AvgEntryPrice-PriceScale*4 Then ExitShort("sx2",AtStop,EntryPrice-PriceScale*4); } if L > mav Then ExitShort("sx21",AtLimit,mav); if H < mav Then ExitShort("sx22",AtStop,mav); } 즐거운 하루되세요 > 제이크 님이 쓴 글입니다. > 제목 : 수식 문의 드립니다. > 안녕하세요. 만들어주신 시스템 로직의 도움을 받아 다양한 변수 조건에서 테스트를 하고 있습니다. 너무 감사합니다. 아래 작성해주신 조건을 바탕으로 강제 청산 조건을 하나 추가 하고 싶습니다. 로직에 따른 미청산이 있을 경우, "상품의 현재가가 20 이평"을 터치할 경우, 무조건 청산이라는 조건을 넣고 싶습니다. 늘 빠르고 훌륭한 로직으로 도와주셔서 감사합니다. #매수진입후 if MarketPosition == 1 Then{ if CurrentContracts > CurrentContracts[1] Then var1 = H; if H > var1 Then var1 = H; #진입이 1번일경우 if MaxEntries == 1 Then{ #15틱 하락하면 1계약 추가매수진입 buy("bb",atlimit,EntryPrice-PriceScale*15,1); #진입가+10틱에 청산 ExitLong("bp1",Atlimit,EntryPrice+PriceScale*10); #4틱이상 상승후 진입가+2틱에 도달하면 매수청산 if var1 >= EntryPrice+PriceScale*4 Then exitlong("bx1",AtStop,EntryPrice+PriceScale*2); } #진입이 2번일 경우 if MaxEntries == 2 Then{ #청산이 아직 발생하지 않은 경우 평단가+4틱 수익이면 1계약청 if CurrentContracts == MaxContracts Then ExitLong("bp21",Atlimit,avgEntryPrice+PriceScale*4,"",1,1); #일부청산이 된 경우 if CurrentContracts < MaxContracts Then #평단가 +10틱이상이면 나머지 청산 ExitLong("bp22",Atlimit,AvgEntryPrice+PriceScale*10); #평단가 +4틱이상 상승후 하락해서 평단가+4틱에 도달하면 나머지 청산 if var1 > AvgEntryPrice+PriceScale*4 Then exitlong("bx2",AtStop,EntryPrice+PriceScale*4); } } #매도진입후 if MarketPosition == -1 Then{ if CurrentContracts > CurrentContracts[1] Then var2 = L; if L < var2 Then var2 = L; #진입이 1번일경우 if MaxEntries == 1 Then{ #15틱 상승하면 1계약 추가매도진입 sell("ss",atlimit,EntryPrice+PriceScale*15,1); #진입가-10틱에 청산 ExitShort("sp1",Atlimit,EntryPrice-PriceScale*10); #4틱 하락 후 진입가-2틱에 도달하면 매도청산 if var2 <= EntryPrice-PriceScale*4 Then ExitShort("sx1",AtStop,EntryPrice-PriceScale*2); } #진입이 2번일 경우 if MaxEntries == 2 Then{ if CurrentContracts == MaxContracts Then ExitShort("sp21",Atlimit,avgEntryPrice-PriceScale*4); if CurrentContracts < MaxContracts Then ExitShort("sp22",Atlimit,AvgEntryPrice-PriceScale*10); if var2 < AvgEntryPrice-PriceScale*4 Then ExitShort("sx2",AtStop,EntryPrice-PriceScale*4); } }