커뮤니티

수식 부탁드립니다

프로필 이미지
미송
2016-12-08 20:05:17
109
글번호 104814
답변완료
일전에 매수는 하방으로 2p 하락시, 매도는 상방으로 2p 상승시 피라미딩 추가진입을 의뢰하여 다음과 같이 작성해 주셨고 모든진입 신호 허용으로 적용한 결과 당초 의도한 대로 시스템이 잘 작동했습니다 if MarketPosition == 1 Then { if MaxContracts < 10 then buy("bb",atlimit,LatestEntryPrice(0)-2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atlimit,LatestEntryPrice(0)+2.0,1); } 이를 반대로 매수시 상승 2p마다 1개씩 매수, 매도시 하락 2p마다 1개씩 매도를 하고자 다름과 같이 수식을 부호를 바꾸어 모든진입 허용으로 적용한 결과 제대로 시스템이 작동하지 않습니다. 원인을 알려주세요 if MarketPosition == 1 Then { if MaxContracts < 10 then buy("bb",atlimit,LatestEntryPrice(0)+2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atlimit,LatestEntryPrice(0)-2.0,1); }
시스템
답변 4
프로필 이미지

예스스탁 예스스탁 답변

2016-12-09 11:05:02

안녕하세요 예스스탁입니다. 신호타입을 atlimit에서 atstop으로 변경하셔야 합니다. 지정한 값 이상의 시세가 발생할때 매수주문(buy,ExitShort)이면 atstop 지정한 값 이하의 시세가 발생할때 매수주문(buy,ExitShort)이면 atlimit 지정한 값 이하의 시세가 발생할때 매도주문(Sell,Exitlong)이면 atstop 지정한 값 이상의 시세가 발생할때 매도주문(Sell,Exitlong)이면 atlimit if MarketPosition == 1 Then { if MaxContracts < 10 then buy("bb",AtStop,LatestEntryPrice(0)+2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",AtStop,LatestEntryPrice(0)-2.0,1); } 즐거운 하루되세요 > 미송 님이 쓴 글입니다. > 제목 : 수식 부탁드립니다 > 일전에 매수는 하방으로 2p 하락시, 매도는 상방으로 2p 상승시 피라미딩 추가진입을 의뢰하여 다음과 같이 작성해 주셨고 모든진입 신호 허용으로 적용한 결과 당초 의도한 대로 시스템이 잘 작동했습니다 if MarketPosition == 1 Then { if MaxContracts < 10 then buy("bb",atlimit,LatestEntryPrice(0)-2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atlimit,LatestEntryPrice(0)+2.0,1); } 이를 반대로 매수시 상승 2p마다 1개씩 매수, 매도시 하락 2p마다 1개씩 매도를 하고자 다름과 같이 수식을 부호를 바꾸어 모든진입 허용으로 적용한 결과 제대로 시스템이 작동하지 않습니다. 원인을 알려주세요 if MarketPosition == 1 Then { if MaxContracts < 10 then buy("bb",atlimit,LatestEntryPrice(0)+2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atlimit,LatestEntryPrice(0)-2.0,1); }
프로필 이미지

미송

2016-12-09 15:46:59

작성해주신 식을 사용해보니 잘 적용이 됩니다. 그런데 다음과 같은 식을 사용해 보니 피라미딩 진입 후 진입된 포인트마다 목표수익이 개별적으로 설정되어 있어 최초 진입가는 목표수익에 도달하여 청산되지만 추후 피라미딩으로 들어간 진입가들은 목표수익에 미달할 경우 자동적으로 로스컷이 되어 버립니다. 또한 전체 진입 평균가에서 로스컷을 설정하고 싶은데 각 개별 진입가마다 로스컷이 설정되어 있습니다 이 두가지점을 수정해주싶시요. 감사합니다 f MarketPosition == 1 Then { if MaxContracts < 10 Then buy("bb",atstop,LatestEntryPrice(0)+2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atstop,LatestEntryPrice(0)-2.0,1); } #진입별 5포인트 수익시 청산 SetStopProfittarget(5,PointStop); if MarketPosition == 1 and c > entryprice + 5 and Relative1 >= 65 Then exitlong("bx1",AtStop,c); if MarketPosition == -1 and c < entryprice - 5 and Relative1 <= 35 Then exitShort("sx1",AtStop,c); if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice + 1.0 Then Exitshort("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-EntryPrice)*0.1); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice - 1.0 Then Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-EntryPrice)*0.1); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) < EntryPrice + 0.5 Then exitlong("bx3",AtStop,EntryPrice-0.3); if highest(H,BarsSinceEntry) >= EntryPrice + 0.5 Then exitlong("bx4",AtStop,EntryPrice+0.06); } if MarketPosition == -1 Then { if Lowest(L,BarsSinceEntry) > EntryPrice - 0.5 Then ExitShort("sx3",AtStop,EntryPrice + 0.3); if Lowest(L,BarsSinceEntry) <= EntryPrice - 0.5 Then ExitShort("sx4",AtStop,EntryPrice-0.06); } > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수식 부탁드립니다 > 안녕하세요 예스스탁입니다. 신호타입을 atlimit에서 atstop으로 변경하셔야 합니다. 지정한 값 이상의 시세가 발생할때 매수주문(buy,ExitShort)이면 atstop 지정한 값 이하의 시세가 발생할때 매수주문(buy,ExitShort)이면 atlimit 지정한 값 이하의 시세가 발생할때 매도주문(Sell,Exitlong)이면 atstop 지정한 값 이상의 시세가 발생할때 매도주문(Sell,Exitlong)이면 atlimit if MarketPosition == 1 Then { if MaxContracts < 10 then buy("bb",AtStop,LatestEntryPrice(0)+2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",AtStop,LatestEntryPrice(0)-2.0,1); } 즐거운 하루되세요 > 미송 님이 쓴 글입니다. > 제목 : 수식 부탁드립니다 > 일전에 매수는 하방으로 2p 하락시, 매도는 상방으로 2p 상승시 피라미딩 추가진입을 의뢰하여 다음과 같이 작성해 주셨고 모든진입 신호 허용으로 적용한 결과 당초 의도한 대로 시스템이 잘 작동했습니다 if MarketPosition == 1 Then { if MaxContracts < 10 then buy("bb",atlimit,LatestEntryPrice(0)-2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atlimit,LatestEntryPrice(0)+2.0,1); } 이를 반대로 매수시 상승 2p마다 1개씩 매수, 매도시 하락 2p마다 1개씩 매도를 하고자 다름과 같이 수식을 부호를 바꾸어 모든진입 허용으로 적용한 결과 제대로 시스템이 작동하지 않습니다. 원인을 알려주세요 if MarketPosition == 1 Then { if MaxContracts < 10 then buy("bb",atlimit,LatestEntryPrice(0)+2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atlimit,LatestEntryPrice(0)-2.0,1); }
프로필 이미지

예스스탁 예스스탁 답변

2016-12-09 16:06:04

안녕하세요 예스스탁입니다. SetStopProfittarget이 진입별로 동작합니다. 평단가 기준으로 하신다면 아래와 같은 식으로 변경하시면 됩니다. #평단가 대비 5포인트수익 발생하면 전량청산 if MarketPosition == 1 Then ExitLong("bp",atlimit,AvgEntryPrice+5); if MarketPosition == -1 Then ExitShort("sp",atlimit,AvgEntryPrice-5); 올려주신 식에는 setstoploss사용이 없는데 아마 설정창에서 지정하신것 같습니다. 위와 마찬가지로 평단가 기준으로 하신 다면 아래와 같은 내용 추가해서 사용하시면 됩니다. #평단가 대비 1포인트 손실 발생하면 전량청산 if MarketPosition == 1 Then ExitLong("bl",atstop,AvgEntryPrice-1); if MarketPosition == -1 Then ExitShort("sl",atstop,AvgEntryPrice+1); 즐거운 하루되세요 > 미송 님이 쓴 글입니다. > 제목 : Re : Re : 수식 부탁드립니다 > 작성해주신 식을 사용해보니 잘 적용이 됩니다. 그런데 다음과 같은 식을 사용해 보니 피라미딩 진입 후 진입된 포인트마다 목표수익이 개별적으로 설정되어 있어 최초 진입가는 목표수익에 도달하여 청산되지만 추후 피라미딩으로 들어간 진입가들은 목표수익에 미달할 경우 자동적으로 로스컷이 되어 버립니다. 또한 전체 진입 평균가에서 로스컷을 설정하고 싶은데 각 개별 진입가마다 로스컷이 설정되어 있습니다 이 두가지점을 수정해주싶시요. 감사합니다 f MarketPosition == 1 Then { if MaxContracts < 10 Then buy("bb",atstop,LatestEntryPrice(0)+2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atstop,LatestEntryPrice(0)-2.0,1); } #진입별 5포인트 수익시 청산 SetStopProfittarget(5,PointStop); if MarketPosition == 1 and c > entryprice + 5 and Relative1 >= 65 Then exitlong("bx1",AtStop,c); if MarketPosition == -1 and c < entryprice - 5 and Relative1 <= 35 Then exitShort("sx1",AtStop,c); if MarketPosition == 1 and highest(h,BarsSinceEntry) >= EntryPrice + 1.0 Then Exitshort("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-EntryPrice)*0.1); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= EntryPrice - 1.0 Then Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-EntryPrice)*0.1); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) < EntryPrice + 0.5 Then exitlong("bx3",AtStop,EntryPrice-0.3); if highest(H,BarsSinceEntry) >= EntryPrice + 0.5 Then exitlong("bx4",AtStop,EntryPrice+0.06); } if MarketPosition == -1 Then { if Lowest(L,BarsSinceEntry) > EntryPrice - 0.5 Then ExitShort("sx3",AtStop,EntryPrice + 0.3); if Lowest(L,BarsSinceEntry) <= EntryPrice - 0.5 Then ExitShort("sx4",AtStop,EntryPrice-0.06); } > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수식 부탁드립니다 > 안녕하세요 예스스탁입니다. 신호타입을 atlimit에서 atstop으로 변경하셔야 합니다. 지정한 값 이상의 시세가 발생할때 매수주문(buy,ExitShort)이면 atstop 지정한 값 이하의 시세가 발생할때 매수주문(buy,ExitShort)이면 atlimit 지정한 값 이하의 시세가 발생할때 매도주문(Sell,Exitlong)이면 atstop 지정한 값 이상의 시세가 발생할때 매도주문(Sell,Exitlong)이면 atlimit if MarketPosition == 1 Then { if MaxContracts < 10 then buy("bb",AtStop,LatestEntryPrice(0)+2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",AtStop,LatestEntryPrice(0)-2.0,1); } 즐거운 하루되세요 > 미송 님이 쓴 글입니다. > 제목 : 수식 부탁드립니다 > 일전에 매수는 하방으로 2p 하락시, 매도는 상방으로 2p 상승시 피라미딩 추가진입을 의뢰하여 다음과 같이 작성해 주셨고 모든진입 신호 허용으로 적용한 결과 당초 의도한 대로 시스템이 잘 작동했습니다 if MarketPosition == 1 Then { if MaxContracts < 10 then buy("bb",atlimit,LatestEntryPrice(0)-2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atlimit,LatestEntryPrice(0)+2.0,1); } 이를 반대로 매수시 상승 2p마다 1개씩 매수, 매도시 하락 2p마다 1개씩 매도를 하고자 다름과 같이 수식을 부호를 바꾸어 모든진입 허용으로 적용한 결과 제대로 시스템이 작동하지 않습니다. 원인을 알려주세요 if MarketPosition == 1 Then { if MaxContracts < 10 then buy("bb",atlimit,LatestEntryPrice(0)+2.0,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atlimit,LatestEntryPrice(0)-2.0,1); }
프로필 이미지

미송

2016-12-09 16:16:07

미송 님에 의해 삭제된 답변입니다.