커뮤니티

수식 수정 부탁드립니다.

프로필 이미지
산수유
2024-07-09 14:54:35
722
글번호 181331
답변완료

첨부 이미지

88013번 문의에서 아래의 알려주신 식대로 적용을 해보니 1차목표수익실현(bp1)후 본절청산(b13)이 나와야 되는데 그렇지가 않은 것 같습니다. 수정 좀 부탁드립니다. 진입 후 아래의 3가지 경우가 있을 거 같습니다. 1차손절당하고 나서(보유포지션은 1개가됨) 1차목표가격도달(나머지 1계약청산) 1차목표치 먼저 도달하면 수익실현. 1.2차손절을 본절로 변경 1차손절가 도달후 2차 손절가도 도달하여 전부 청산되는 경우 참고해주셔요 if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+100); if CurrentContracts == MaxContracts Then ExitLong("Bl1",AtStop,EntryPrice-20,"",1,1); Else ExitLong("Bl3",AtStop,EntryPrice,"",1,1); ExitLong("Bl2",AtStop,EntryPrice-40); } if MarketPosition == -1 Then { ExitShort("Sp1",AtLimit,EntryPrice-50,"",1,1); ExitShort("Sp2",AtLimit,EntryPrice-100); if CurrentContracts == MaxContracts Then ExitShort("Sl1",AtStop,EntryPrice+20,"",1,1); Else ExitShort("Sl3",AtStop,EntryPrice,"",1,1); ExitShort("Sl2",AtStop,EntryPrice+40); }
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2024-07-09 15:50:43

안녕하세요 예스스탁입니다. 수정한 식입니다. if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+100); if CurrentContracts == MaxContracts Then ExitLong("Bl1",AtStop,EntryPrice-20,"",1,1); Else { if LatestExitName(0) == "Bp1" Then ExitLong("Bl3",AtStop,EntryPrice,"",1,1); } ExitLong("Bl2",AtStop,EntryPrice-40); } if MarketPosition == -1 Then { ExitShort("Sp1",AtLimit,EntryPrice-50,"",1,1); ExitShort("Sp2",AtLimit,EntryPrice-100); if CurrentContracts == MaxContracts Then ExitShort("Sl1",AtStop,EntryPrice+20,"",1,1); Else { if LatestExitName(0) == "Sp1" Then ExitShort("Sl3",AtStop,EntryPrice,"",1,1); } ExitShort("Sl2",AtStop,EntryPrice+40); } 즐거운 하루되세요 > 산수유 님이 쓴 글입니다. > 제목 : 수식 수정 부탁드립니다. > 88013번 문의에서 아래의 알려주신 식대로 적용을 해보니 1차목표수익실현(bp1)후 본절청산(b13)이 나와야 되는데 그렇지가 않은 것 같습니다. 수정 좀 부탁드립니다. 진입 후 아래의 3가지 경우가 있을 거 같습니다. 1차손절당하고 나서(보유포지션은 1개가됨) 1차목표가격도달(나머지 1계약청산) 1차목표치 먼저 도달하면 수익실현. 1.2차손절을 본절로 변경 1차손절가 도달후 2차 손절가도 도달하여 전부 청산되는 경우 참고해주셔요 if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+100); if CurrentContracts == MaxContracts Then ExitLong("Bl1",AtStop,EntryPrice-20,"",1,1); Else ExitLong("Bl3",AtStop,EntryPrice,"",1,1); ExitLong("Bl2",AtStop,EntryPrice-40); } if MarketPosition == -1 Then { ExitShort("Sp1",AtLimit,EntryPrice-50,"",1,1); ExitShort("Sp2",AtLimit,EntryPrice-100); if CurrentContracts == MaxContracts Then ExitShort("Sl1",AtStop,EntryPrice+20,"",1,1); Else ExitShort("Sl3",AtStop,EntryPrice,"",1,1); ExitShort("Sl2",AtStop,EntryPrice+40); }
프로필 이미지

산수유

2024-07-09 20:29:07

매번감사드립니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수식 수정 부탁드립니다. > 안녕하세요 예스스탁입니다. 수정한 식입니다. if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+100); if CurrentContracts == MaxContracts Then ExitLong("Bl1",AtStop,EntryPrice-20,"",1,1); Else { if LatestExitName(0) == "Bp1" Then ExitLong("Bl3",AtStop,EntryPrice,"",1,1); } ExitLong("Bl2",AtStop,EntryPrice-40); } if MarketPosition == -1 Then { ExitShort("Sp1",AtLimit,EntryPrice-50,"",1,1); ExitShort("Sp2",AtLimit,EntryPrice-100); if CurrentContracts == MaxContracts Then ExitShort("Sl1",AtStop,EntryPrice+20,"",1,1); Else { if LatestExitName(0) == "Sp1" Then ExitShort("Sl3",AtStop,EntryPrice,"",1,1); } ExitShort("Sl2",AtStop,EntryPrice+40); } 즐거운 하루되세요 > 산수유 님이 쓴 글입니다. > 제목 : 수식 수정 부탁드립니다. > 88013번 문의에서 아래의 알려주신 식대로 적용을 해보니 1차목표수익실현(bp1)후 본절청산(b13)이 나와야 되는데 그렇지가 않은 것 같습니다. 수정 좀 부탁드립니다. 진입 후 아래의 3가지 경우가 있을 거 같습니다. 1차손절당하고 나서(보유포지션은 1개가됨) 1차목표가격도달(나머지 1계약청산) 1차목표치 먼저 도달하면 수익실현. 1.2차손절을 본절로 변경 1차손절가 도달후 2차 손절가도 도달하여 전부 청산되는 경우 참고해주셔요 if MarketPosition == 1 Then { ExitLong("Bp1",AtLimit,EntryPrice+50,"",1,1); ExitLong("Bp2",AtLimit,EntryPrice+100); if CurrentContracts == MaxContracts Then ExitLong("Bl1",AtStop,EntryPrice-20,"",1,1); Else ExitLong("Bl3",AtStop,EntryPrice,"",1,1); ExitLong("Bl2",AtStop,EntryPrice-40); } if MarketPosition == -1 Then { ExitShort("Sp1",AtLimit,EntryPrice-50,"",1,1); ExitShort("Sp2",AtLimit,EntryPrice-100); if CurrentContracts == MaxContracts Then ExitShort("Sl1",AtStop,EntryPrice+20,"",1,1); Else ExitShort("Sl3",AtStop,EntryPrice,"",1,1); ExitShort("Sl2",AtStop,EntryPrice+40); }