커뮤니티

분할매수한 종목의 매수청산시 ..일정 수익률에 도달시 일괄매도하는 수식을 알려줏세요...

프로필 이미지
이형지
2018-09-25 16:15:04
245
글번호 122239
답변완료
국내 ETF kodex200종목을 RSI(14)< 20 일때 신호시마다 매수를 하여서 최대 100회 매수 전체 평균 수익률이 5%일때 전량 매도하는 매수 청산 수식좀 알려주세요.... 설정에서 목표수익을 기입하는 란이 있는데 그것을 해보니까... 매수된것에 일괄매도가 아니라 각각 매수한 금액에서 +5%일때 각각 매도가 되더라고요.. 일단 저는 매수를 여러번했을때 그것에 대한 평균 매수가에 +5일때 일괄 매도가 될수 있도록 되는 수식을 알려주시면 감사하겠습니다. 참고로 매수 평균 금액에서 수익이 5% 33% 분할매도 7% 33% 분할매도 10%일때 나머지 분할매도가 구현이 되나요>????? 구현된다면 그것도 알려주시면 감사하겠습니다. 수고하세요~~
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2018-09-27 15:01:24

안녕하세요 예스스탁입니다 1. if RSI(14)< 20 Then buy("b"); if MarketPosition == 1 Then exitlong("bx",atlimit,AvgEntryPrice*1.05); 2 if RSI(14)< 20 and MaxEntries < 100 Then buy("b"); if MarketPosition == 1 Then { if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bx1" Then Condition1 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bx2" Then Condition2 = true; if CurrentContracts < CurrentContracts[1] and LatestExitName(0) == "bx3" Then Condition3 = true; if Condition1 == false then exitlong("bx1",atlimit,AvgEntryPrice*1.05,"",Floor(MaxContracts*(1/3)),1); if Condition2 == false then exitlong("bx2",atlimit,AvgEntryPrice*1.07,"",Floor(MaxContracts*(1/3)),1); if Condition3 == false then exitlong("bx3",atlimit,AvgEntryPrice*1.10); } Else { Condition1 = false; Condition2 = false; Condition3 = false; } 즐거운 하루되세요 > 이형지 님이 쓴 글입니다. > 제목 : 분할매수한 종목의 매수청산시 ..일정 수익률에 도달시 일괄매도하는 수식을 알려줏세