커뮤니티

시스템 수식 부탁드립니다

프로필 이미지
미송
2016-12-09 18:23:40
151
글번호 104859
답변완료

첨부 이미지

제가 만들려고 하는 시스템은 그림1처럼 최초 진입자리에서 수익시 1.5p 마다 추가진입하고 최초 진입가에서 5p이상 상승시 청산조건을 찾고, 청산조건을 못찾은 경우 수익 7p에서 잔량 모두를 청산하는 시스템입니다. 또한 손절은 피라미딩을 들어간 평균단가 대비 0.5p 이하로 상승시 +-0.3p에서 청산하고 평균단가가 0.5p이상 수익발생하고 떨어질 경우 진입가에서 손절하는 시스템이며, 평균단가 대비 1p이상 수익이 발생하고 수익금이 최고수익 대비 80% 하락할 경우 트레일링 스탑을 적용하게 작성한 것입니다. 하지만 그림2를 보면 손절이 각 개별 진입가에서 작동해서 손절이 이루어 지고 있습니다. 시스템 식에 무슨 문제가 있는지 확인 부탁드립니다. 감사합니다 if MarketPosition == 1 Then { if MaxContracts < 10 Then buy("bb",atstop,LatestEntryPrice(0)+1.5,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atstop,LatestEntryPrice(0)-1.5,1); } /*#진입별 1.5포인트 수익시 청산 SetStopProfittarget(7,PointStop);*/ if MarketPosition == 1 Then ExitLong("bp",atlimit,AvgEntryPrice+7); if MarketPosition == -1 Then ExitShort("sp",atlimit,AvgEntryPrice-7); 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) >= avgEntryPrice + 1.0 Then Exitshort("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-avgEntryPrice)*0.2); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= avgEntryPrice - 1.0 Then Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-avgEntryPrice)*0.2); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) < avgEntryPrice + 0.5 Then exitlong("bx3",AtStop,avgEntryPrice-0.3); if highest(H,BarsSinceEntry) >= avgEntryPrice + 0.5 Then exitlong("bx4",AtStop,avgEntryPrice); } if MarketPosition == -1 Then { if Lowest(L,BarsSinceEntry) > avgEntryPrice - 0.5 Then ExitShort("sx3",AtStop,avgEntryPrice + 0.3); if Lowest(L,BarsSinceEntry) <= avgEntryPrice - 0.5 Then ExitShort("sx4",AtStop,avgEntryPrice); }
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2016-12-12 09:44:02

안녕하세요 예스스탁입니다. 그림2의 빨간색동그라미의 S는 강제청산입니다. 수식에서 강제청산함수인 SetStopLoss를 사용하셨거나 시스템 트레이딩 설정창의 강제청산탭에서 손절매를 설정해서 발생하는 신호입니다. 올려주신 식에서는 SetStopLoss가 없으므로 설정창의 강제청산탭에서 손절매를 설정한 상태이므로 설정창에서 손절매 체크를 해제하셔야 합니다. 즐거운 하루되세요 > 미송 님이 쓴 글입니다. > 제목 : 시스템 수식 부탁드립니다 > 제가 만들려고 하는 시스템은 그림1처럼 최초 진입자리에서 수익시 1.5p 마다 추가진입하고 최초 진입가에서 5p이상 상승시 청산조건을 찾고, 청산조건을 못찾은 경우 수익 7p에서 잔량 모두를 청산하는 시스템입니다. 또한 손절은 피라미딩을 들어간 평균단가 대비 0.5p 이하로 상승시 +-0.3p에서 청산하고 평균단가가 0.5p이상 수익발생하고 떨어질 경우 진입가에서 손절하는 시스템이며, 평균단가 대비 1p이상 수익이 발생하고 수익금이 최고수익 대비 80% 하락할 경우 트레일링 스탑을 적용하게 작성한 것입니다. 하지만 그림2를 보면 손절이 각 개별 진입가에서 작동해서 손절이 이루어 지고 있습니다. 시스템 식에 무슨 문제가 있는지 확인 부탁드립니다. 감사합니다 if MarketPosition == 1 Then { if MaxContracts < 10 Then buy("bb",atstop,LatestEntryPrice(0)+1.5,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atstop,LatestEntryPrice(0)-1.5,1); } /*#진입별 1.5포인트 수익시 청산 SetStopProfittarget(7,PointStop);*/ if MarketPosition == 1 Then ExitLong("bp",atlimit,AvgEntryPrice+7); if MarketPosition == -1 Then ExitShort("sp",atlimit,AvgEntryPrice-7); 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) >= avgEntryPrice + 1.0 Then Exitshort("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-avgEntryPrice)*0.2); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= avgEntryPrice - 1.0 Then Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-avgEntryPrice)*0.2); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) < avgEntryPrice + 0.5 Then exitlong("bx3",AtStop,avgEntryPrice-0.3); if highest(H,BarsSinceEntry) >= avgEntryPrice + 0.5 Then exitlong("bx4",AtStop,avgEntryPrice); } if MarketPosition == -1 Then { if Lowest(L,BarsSinceEntry) > avgEntryPrice - 0.5 Then ExitShort("sx3",AtStop,avgEntryPrice + 0.3); if Lowest(L,BarsSinceEntry) <= avgEntryPrice - 0.5 Then ExitShort("sx4",AtStop,avgEntryPrice); }
프로필 이미지

미송

2016-12-12 19:09:11

SetStopLoss 설정시 개별 진입가 대비 0.3p 손실시 청산이 아니고 평균 진입가 대비 0.3p 손실시 청산인 식을 부탁드립니다. 또 트레일링 스탑시도 개별 진입가로 최고 수익 대비 80% 하락(1p 이상 수익 후)일 경우 청산이 아니고 평균 진입가 기준 최고수익 대비 80% 하락(1p이상 수익 후)일 경우 청산식을 부탁드립니다. 감사합니다 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 시스템 수식 부탁드립니다 > 안녕하세요 예스스탁입니다. 그림2의 빨간색동그라미의 S는 강제청산입니다. 수식에서 강제청산함수인 SetStopLoss를 사용하셨거나 시스템 트레이딩 설정창의 강제청산탭에서 손절매를 설정해서 발생하는 신호입니다. 올려주신 식에서는 SetStopLoss가 없으므로 설정창의 강제청산탭에서 손절매를 설정한 상태이므로 설정창에서 손절매 체크를 해제하셔야 합니다. 즐거운 하루되세요 > 미송 님이 쓴 글입니다. > 제목 : 시스템 수식 부탁드립니다 > 제가 만들려고 하는 시스템은 그림1처럼 최초 진입자리에서 수익시 1.5p 마다 추가진입하고 최초 진입가에서 5p이상 상승시 청산조건을 찾고, 청산조건을 못찾은 경우 수익 7p에서 잔량 모두를 청산하는 시스템입니다. 또한 손절은 피라미딩을 들어간 평균단가 대비 0.5p 이하로 상승시 +-0.3p에서 청산하고 평균단가가 0.5p이상 수익발생하고 떨어질 경우 진입가에서 손절하는 시스템이며, 평균단가 대비 1p이상 수익이 발생하고 수익금이 최고수익 대비 80% 하락할 경우 트레일링 스탑을 적용하게 작성한 것입니다. 하지만 그림2를 보면 손절이 각 개별 진입가에서 작동해서 손절이 이루어 지고 있습니다. 시스템 식에 무슨 문제가 있는지 확인 부탁드립니다. 감사합니다 if MarketPosition == 1 Then { if MaxContracts < 10 Then buy("bb",atstop,LatestEntryPrice(0)+1.5,1); } if MarketPosition == -1 Then { if MaxContracts < 10 Then sell("ss",atstop,LatestEntryPrice(0)-1.5,1); } /*#진입별 1.5포인트 수익시 청산 SetStopProfittarget(7,PointStop);*/ if MarketPosition == 1 Then ExitLong("bp",atlimit,AvgEntryPrice+7); if MarketPosition == -1 Then ExitShort("sp",atlimit,AvgEntryPrice-7); 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) >= avgEntryPrice + 1.0 Then Exitshort("bx2",AtStop,highest(H,BarsSinceEntry) - abs(highest(H,BarsSinceEntry)-avgEntryPrice)*0.2); if MarketPosition == -1 and lowest(L,BarsSinceEntry) <= avgEntryPrice - 1.0 Then Exitshort("Sx2",AtStop,lowest(L,BarsSinceEntry) + abs(lowest(L,BarsSinceEntry)-avgEntryPrice)*0.2); if MarketPosition == 1 Then { if highest(H,BarsSinceEntry) < avgEntryPrice + 0.5 Then exitlong("bx3",AtStop,avgEntryPrice-0.3); if highest(H,BarsSinceEntry) >= avgEntryPrice + 0.5 Then exitlong("bx4",AtStop,avgEntryPrice); } if MarketPosition == -1 Then { if Lowest(L,BarsSinceEntry) > avgEntryPrice - 0.5 Then ExitShort("sx3",AtStop,avgEntryPrice + 0.3); if Lowest(L,BarsSinceEntry) <= avgEntryPrice - 0.5 Then ExitShort("sx4",AtStop,avgEntryPrice); }