커뮤니티

분할매도

프로필 이미지
티끌
2016-11-29 11:08:15
119
글번호 104469
답변완료
3~5%사이 수익에서 최고가대비30%하락시 보유주식수의 33%청산 5~7%사이 수익에서 최고가대비30%하락시 보유주식수의 33%청산 10%이상 수익에서 최고가대비30%하락시 나머지 청산 이런질문으로 해서 아래와 같이 답변해 주셨는데요.... 제가 잘못알고있는게 아닌지 확인하고싶어서 재질문합니다 아래의 산식은 주식수 100주일때 1차에 33주 팔고 2차에 33주 파는게 아니라 (100-33주)*0.33=22주를 파는게 아닌가요? -----아 래--- var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); if MarketPosition == 1 then{ HH = highest(H,BarsSinceEntry); if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx1" Then Bxcond1 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx2" Then Bxcond2 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx3" Then Bxcond3 = true; if Bxcond1 == false and HH >= EntryPrice*1.03 and HH < EntryPrice*1.05 Then ExitLong("Bx1",AtStop,HH-(HH-EntryPrice)*0.3,"",Floor(MaxContracts*(1/3)),1); if Bxcond2 == false and HH >= EntryPrice*1.05 and HH < EntryPrice*1.07 Then ExitLong("Bx2",AtStop,HH-(HH-EntryPrice)*0.3,"",Floor(MaxContracts*(1/3)),1); if Bxcond3 == false and HH >= EntryPrice*1.10 Then ExitLong("Bx3",AtStop,HH-(HH-EntryPrice)*0.3); } Else{ Bxcond1 = false; Bxcond2 = false; Bxcond3 = false; } if MarketPosition == -1 then{ LL = Lowest(L,BarsSinceEntry); if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx1" Then Sxcond1 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx2" Then Sxcond2 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx3" Then Sxcond3 = true; if Sxcond1 == false and LL <= EntryPrice*0.97 and LL < EntryPrice*0.95 Then ExitShort("Sx1",AtStop,LL+(EntryPrice-LL)*0.3,"",Floor(MaxContracts*(1/3)),1); if Sxcond2 == false and LL <= EntryPrice*0.95 and LL < EntryPrice*0.93 Then ExitShort("Sx2",AtStop,LL+(EntryPrice-LL)*0.3,"",Floor(MaxContracts*(1/3)),1); if Sxcond3 == false and LL <= EntryPrice*0.90 Then ExitShort("Sx3",AtStop,LL+(EntryPrice-LL)*0.3); } Else{ Sxcond1 = false; Sxcond2 = false; Sxcond3 = false; } 즐거운 하루되세요
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-11-29 14:02:52

안녕하세요 예스스탁입니다. 기존식이 전체진입수량에서 일정%씩 청산합니다. 100주 진입하면 1차에 33주, 2차에 33주, 3차에 남은 수량 모두 청산입니다. 식에 보시면 수량이 MaxContracts을 기준으로 합니다. 현재 남은 수량에서 일정%이면 CurrentContracts가 되어야 합니다. 즐거운 하루되세요 > 티끌 님이 쓴 글입니다. > 제목 : 분할매도 > 3~5%사이 수익에서 최고가대비30%하락시 보유주식수의 33%청산 5~7%사이 수익에서 최고가대비30%하락시 보유주식수의 33%청산 10%이상 수익에서 최고가대비30%하락시 나머지 청산 이런질문으로 해서 아래와 같이 답변해 주셨는데요.... 제가 잘못알고있는게 아닌지 확인하고싶어서 재질문합니다 아래의 산식은 주식수 100주일때 1차에 33주 팔고 2차에 33주 파는게 아니라 (100-33주)*0.33=22주를 파는게 아닌가요? -----아 래--- var : HH(0),Bxcond1(false),Bxcond2(false),Bxcond3(false); var : LL(0),Sxcond1(false),Sxcond2(false),Sxcond3(false); if MarketPosition == 1 then{ HH = highest(H,BarsSinceEntry); if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx1" Then Bxcond1 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx2" Then Bxcond2 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Bx3" Then Bxcond3 = true; if Bxcond1 == false and HH >= EntryPrice*1.03 and HH < EntryPrice*1.05 Then ExitLong("Bx1",AtStop,HH-(HH-EntryPrice)*0.3,"",Floor(MaxContracts*(1/3)),1); if Bxcond2 == false and HH >= EntryPrice*1.05 and HH < EntryPrice*1.07 Then ExitLong("Bx2",AtStop,HH-(HH-EntryPrice)*0.3,"",Floor(MaxContracts*(1/3)),1); if Bxcond3 == false and HH >= EntryPrice*1.10 Then ExitLong("Bx3",AtStop,HH-(HH-EntryPrice)*0.3); } Else{ Bxcond1 = false; Bxcond2 = false; Bxcond3 = false; } if MarketPosition == -1 then{ LL = Lowest(L,BarsSinceEntry); if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx1" Then Sxcond1 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx2" Then Sxcond2 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "Sx3" Then Sxcond3 = true; if Sxcond1 == false and LL <= EntryPrice*0.97 and LL < EntryPrice*0.95 Then ExitShort("Sx1",AtStop,LL+(EntryPrice-LL)*0.3,"",Floor(MaxContracts*(1/3)),1); if Sxcond2 == false and LL <= EntryPrice*0.95 and LL < EntryPrice*0.93 Then ExitShort("Sx2",AtStop,LL+(EntryPrice-LL)*0.3,"",Floor(MaxContracts*(1/3)),1); if Sxcond3 == false and LL <= EntryPrice*0.90 Then ExitShort("Sx3",AtStop,LL+(EntryPrice-LL)*0.3); } Else{ Sxcond1 = false; Sxcond2 = false; Sxcond3 = false; } 즐거운 하루되세요