커뮤니티

수식문의 드립니다.

프로필 이미지
로렌스
2014-02-05 17:26:48
129
글번호 72225
답변완료
밑에 답변 감사합니다. 궁금한게 있어서 추가적으로 문의드립니다. 시스템 익절과 손절 전략을 코딩으로 하니 꼬리로 틱으로 찍기만 해도 청산이 된 것으로 나오는데요. 이것을 좀 보완하고 싶습니다. 1) 기본적으로 4틱 익절, 6틱 손절인데 청산가격이 진입가 대비해서 5틱을 꼭 도달해야만 청산이 4틱으로 되게끔 하고 싶습니다. (11시~13시 사이에는 2틱 익절, 6틱 손절로 진입가 대비 3틱이 도달해야만 청산이 2틱으로 나간 것으로 시스템을 전략을 구성하고 싶습니다.) 이런 방식으로도 구현 가능 할까요? 매번 감사합니다. 수고하세요~ ================================================================================ 아래는 일전에 문의 드렸던 시스템에서 11시~13시 사이에서 청산과 손절 전략으로 진입가 대비 2틱 익절 / 6틱 손절 // 나머지는 4틱익절, 6틱 손절 코딩 참고적으로 올립니다. if stime >= 110000 and stime < 130000 Then{ if MarketPosition == 1 Then{ ExitLong("1",AtLimit,EntryPrice+PriceScale*2); ExitLong("2",AtStop,EntryPrice-PriceScale*6); } if MarketPosition == -1 Then{ ExitShort("3",AtLimit,EntryPrice-PriceScale*2); ExitShort("4",AtStop,EntryPrice+PriceScale*6); } } Else{ if MarketPosition == 1 Then{ ExitLong("5",AtLimit,EntryPrice+PriceScale*4); ExitLong("6",AtStop,EntryPrice-PriceScale*6); } if MarketPosition == -1 Then{ ExitShort("7",AtLimit,EntryPrice-PriceScale*4); ExitShort("8",AtStop,EntryPrice+PriceScale*6); } }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2014-02-06 11:16:58

안녕하세요 예스스탁입니다. 수익청산의 경우 지정한 수익보다 1틱이상 수익이 더 발생하고 해당 수익으로 돌아올때 청산하게 수정했습니다. if stime >= 110000 and stime < 130000 Then{ if MarketPosition == 1 Then{ var1 = highest(H,BarsSinceEntry); if var1 >= EntryPrice+PriceScale*3 Then{ ExitLong("1",AtStop,EntryPrice+PriceScale*2); } ExitLong("2",AtStop,EntryPrice-PriceScale*6); } if MarketPosition == -1 Then{ var2 = lowest(L,BarsSinceEntry); if var2 <= EntryPrice+PriceScale*3 Then{ ExitShort("3",AtStop,EntryPrice-PriceScale*2); } ExitShort("4",AtStop,EntryPrice+PriceScale*6); } } Else{ if MarketPosition == 1 Then{ var1 = highest(H,BarsSinceEntry); if var1 >= EntryPrice+PriceScale*5 Then{ ExitLong("5",AtLimit,EntryPrice+PriceScale*4); } ExitLong("6",AtStop,EntryPrice-PriceScale*6); } if MarketPosition == -1 Then{ var2 = lowest(L,BarsSinceEntry); if var2 <= EntryPrice+PriceScale*5 Then{ ExitShort("7",AtLimit,EntryPrice-PriceScale*4); } ExitShort("8",AtStop,EntryPrice+PriceScale*6); } } 즐거운 하루되세요 > 로렌스 님이 쓴 글입니다. > 제목 : 수식문의 드립니다. > 밑에 답변 감사합니다. 궁금한게 있어서 추가적으로 문의드립니다. 시스템 익절과 손절 전략을 코딩으로 하니 꼬리로 틱으로 찍기만 해도 청산이 된 것으로 나오는데요. 이것을 좀 보완하고 싶습니다. 1) 기본적으로 4틱 익절, 6틱 손절인데 청산가격이 진입가 대비해서 5틱을 꼭 도달해야만 청산이 4틱으로 되게끔 하고 싶습니다. (11시~13시 사이에는 2틱 익절, 6틱 손절로 진입가 대비 3틱이 도달해야만 청산이 2틱으로 나간 것으로 시스템을 전략을 구성하고 싶습니다.) 이런 방식으로도 구현 가능 할까요? 매번 감사합니다. 수고하세요~ ================================================================================ 아래는 일전에 문의 드렸던 시스템에서 11시~13시 사이에서 청산과 손절 전략으로 진입가 대비 2틱 익절 / 6틱 손절 // 나머지는 4틱익절, 6틱 손절 코딩 참고적으로 올립니다. if stime >= 110000 and stime < 130000 Then{ if MarketPosition == 1 Then{ ExitLong("1",AtLimit,EntryPrice+PriceScale*2); ExitLong("2",AtStop,EntryPrice-PriceScale*6); } if MarketPosition == -1 Then{ ExitShort("3",AtLimit,EntryPrice-PriceScale*2); ExitShort("4",AtStop,EntryPrice+PriceScale*6); } } Else{ if MarketPosition == 1 Then{ ExitLong("5",AtLimit,EntryPrice+PriceScale*4); ExitLong("6",AtStop,EntryPrice-PriceScale*6); } if MarketPosition == -1 Then{ ExitShort("7",AtLimit,EntryPrice-PriceScale*4); ExitShort("8",AtStop,EntryPrice+PriceScale*6); } }