커뮤니티

질문입니다

프로필 이미지
율이파파
2013-08-22 00:59:45
99
글번호 66695
답변완료
안녕하세요. 아래 수식에서 수익손절비율을 조절하려면 어느부분을 어떻게 수정해야 하나요? 설명 부탁드립니다. if MarketPosition == 1 Then{ if stime < 100000 Then{ ExitLong("BP1",atlimit,EntryPrice*1.02); ExitLong("BL1",AtStop,EntryPrice*0.98); } if stime >= 100000 and stime < 120000 Then{ ExitLong("BP2",atlimit,EntryPrice*1.01); ExitLong("BL2",AtStop,EntryPrice*0.99); } } if MarketPosition == -1 Then{ if stime < 100000 Then{ ExitShort("SP1",atlimit,EntryPrice*0.98); ExitShort("SL1",AtStop,EntryPrice*1.02); } if stime >= 100000 and stime < 120000 Then{ ExitShort("SP2",atlimit,EntryPrice*0.99); ExitShort("SL2",AtStop,EntryPrice*1.01); } } 위와 같이 작성하시면 10시 이전에는 수익손절을 2%로 하고 10시~12시 사이에는 1%로 합니다. 10시 이전에 진입한 부분도 10시 넘어가면 1% 조정됩니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-08-22 10:18:32

안녕하세요 예스스탁입니다. 진입가격 곱한값이 비율입니다. EntryPrice*1.02 진입가격에서 2% 높은 가격 EntryPrice*0.98 진입가격에서 2% 낮은 가격입니다. 외부변수로 처리해서 올려드립니다. 수익1과 손실1이 10시전, 수익1와 손실2가 10~12시 사이입니다. input : 수익1(2),손실1(2),수익2(1),손실2(1); if MarketPosition == 1 Then{ if stime < 100000 Then{ //진입가 ExitLong("BP1",atlimit,EntryPrice*(1+수익1/100)); ExitLong("BL1",AtStop,EntryPrice*(1-손실1/100)); } if stime >= 100000 and stime < 120000 Then{ ExitLong("BP2",atlimit,EntryPrice*(1+수익2/100)); ExitLong("BL2",AtStop,EntryPrice*(1-손실2/100)); } } if MarketPosition == -1 Then{ if stime < 100000 Then{ ExitShort("SP1",atlimit,EntryPrice*(1-수익1/100)); ExitShort("SL1",AtStop,EntryPrice*(1+손실1/100)); } if stime >= 100000 and stime < 120000 Then{ ExitShort("SP2",atlimit,EntryPrice*(1-수익2/100)); ExitShort("SL2",AtStop,EntryPrice*(1+손실2/100)); } } 즐거운 하루되세요 > 율이파파 님이 쓴 글입니다. > 제목 : 질문입니다 > 안녕하세요. 아래 수식에서 수익손절비율을 조절하려면 어느부분을 어떻게 수정해야 하나요? 설명 부탁드립니다. if MarketPosition == 1 Then{ if stime < 100000 Then{ ExitLong("BP1",atlimit,EntryPrice*1.02); ExitLong("BL1",AtStop,EntryPrice*0.98); } if stime >= 100000 and stime < 120000 Then{ ExitLong("BP2",atlimit,EntryPrice*1.01); ExitLong("BL2",AtStop,EntryPrice*0.99); } } if MarketPosition == -1 Then{ if stime < 100000 Then{ ExitShort("SP1",atlimit,EntryPrice*0.98); ExitShort("SL1",AtStop,EntryPrice*1.02); } if stime >= 100000 and stime < 120000 Then{ ExitShort("SP2",atlimit,EntryPrice*0.99); ExitShort("SL2",AtStop,EntryPrice*1.01); } } 위와 같이 작성하시면 10시 이전에는 수익손절을 2%로 하고 10시~12시 사이에는 1%로 합니다. 10시 이전에 진입한 부분도 10시 넘어가면 1% 조정됩니다.