커뮤니티

청산 수식 부탁드려요( 국내 주식)

프로필 이미지
이형지
2020-04-27 12:48:18
1203
글번호 138385
답변완료
지금 사용하고 있는 분할매수 일괄 청산 수식인데요... 분할매수는 유지하고 일괄 청산을 --> 분할 청산으로 하고 있습니다. 전체 매수 금액의 평균값에서 5% 수익시 25% 청산 10% 수익시 50% 청산 15% 수익시 75% 청산 20% 수익시 100% 청산 하는 분할 매수 청산 하는 수식을 반영부탁드릴께요.. 사용하는 수식입니다. 참고로 분봉 매매입니다. 국내 주식 input : n(200),하락퍼센트(0.95),하락퍼센트률(0.05); input : p(20),MFI값(70), MFI값하락률(5); input : 전일대비하락률(0.5); input : 매매수(300),금액1(10),금액2(20),금액3(30),금액4(100),금액5(200),금액6(200),금액7(300),금액8(300); input : 일괄청산률(9); var1 = highest(H,n); var2 = mfi(P); if stime < 143000 then { if MaxEntries < 매매수 and c < var1*하락퍼센트 and var2 < MFI값 and c < o and c <= c[1]*(100-전일대비하락률)/100 Then buy("b1",OnClose,def,Floor(금액1*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률) and var2 < (MFI값- MFI값하락률) and c < o and c <= c[1]*(99.4-전일대비하락률)/100 Then buy("b2",OnClose,def,Floor(금액2*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*2) and var2 < (MFI값- MFI값하락률*2) and c < o and c <= c[1]*(100-전일대비하락률*2)/100 Then buy("b3",OnClose,def,Floor(금액3*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*3) and var2 < (MFI값- MFI값하락률*3) and c < o and c <= c[1]*( 100-전일대비하락률*3)/100 Then buy("b4",OnClose,def,Floor(금액4*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*4) and var2 < (MFI값- MFI값하락률*4) and c < o and c <= c[1]*( 100-전일대비하락률*4)/100 Then buy("b5",OnClose,def,Floor(금액5*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*5) and var2 < (MFI값- MFI값하락률*5) and c < o and c <= c[1]*( 100-전일대비하락률*5)/100 Then buy("b6",OnClose,def,Floor(금액6*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*6) and var2 < (MFI값- MFI값하락률*6) and c < o and c <= c[1]*( 100-전일대비하락률*6)/100 Then buy("b7",OnClose,def,Floor(금액6*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*7) and var2 < (MFI값- MFI값하락률*7) and c < o and c <= c[1]*( 100-전일대비하락률*7)/100 Then buy("b8",OnClose,def,Floor(금액6*10000/c)); ExitLong("bx",atlimit,AvgEntryPrice*(1+일괄청산률*0.01)); } Else SetStopProfittarget(0);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-04-28 11:32:23

안녕하세요 예스스탁입니다. 지정한 수익 달성시 현재 수량에서 지정한 % 청산되게 작성해 드립니다. input : n(200),하락퍼센트(0.95),하락퍼센트률(0.05); input : p(20),MFI값(70), MFI값하락률(5); input : 전일대비하락률(0.5); input : 매매수(300),금액1(10),금액2(20),금액3(30),금액4(100),금액5(200),금액6(200),금액7(300),금액8(300); input : 일괄청산률(9); var1 = highest(H,n); var2 = mfi(P); if stime < 143000 then { if MaxEntries < 매매수 and c < var1*하락퍼센트 and var2 < MFI값 and c < o and c <= c[1]*(100-전일대비하락률)/100 Then buy("b1",OnClose,def,Floor(금액1*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률) and var2 < (MFI값- MFI값하락률) and c < o and c <= c[1]*(99.4-전일대비하락률)/100 Then buy("b2",OnClose,def,Floor(금액2*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*2) and var2 < (MFI값- MFI값하락률*2) and c < o and c <= c[1]*(100-전일대비하락률*2)/100 Then buy("b3",OnClose,def,Floor(금액3*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*3) and var2 < (MFI값- MFI값하락률*3) and c < o and c <= c[1]*( 100-전일대비하락률*3)/100 Then buy("b4",OnClose,def,Floor(금액4*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*4) and var2 < (MFI값- MFI값하락률*4) and c < o and c <= c[1]*( 100-전일대비하락률*4)/100 Then buy("b5",OnClose,def,Floor(금액5*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*5) and var2 < (MFI값- MFI값하락률*5) and c < o and c <= c[1]*( 100-전일대비하락률*5)/100 Then buy("b6",OnClose,def,Floor(금액6*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*6) and var2 < (MFI값- MFI값하락률*6) and c < o and c <= c[1]*( 100-전일대비하락률*6)/100 Then buy("b7",OnClose,def,Floor(금액6*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*7) and var2 < (MFI값- MFI값하락률*7) and c < o and c <= c[1]*( 100-전일대비하락률*7)/100 Then buy("b8",OnClose,def,Floor(금액6*10000/c)); } if MarketPosition == 1 then { if CurrentContracts > CurrentContracts[1] Then { Condition1 = false; Condition2 = false; Condition3 = false; Condition4 = false; } if CurrentContracts > CurrentContracts[1] Then { if LatestExitName(0) == "bx1" Then Condition1 = true; if LatestExitName(0) == "bx2" Then Condition2 = true; if LatestExitName(0) == "bx3" Then Condition3 = true; if LatestExitName(0) == "bx4" Then Condition4 = true; } if Condition1 == true then ExitLong("bx1",Atlimit,AvgEntryPrice*1.05,"",Floor(CurrentContracts*0.25),1); if Condition2 == true then ExitLong("bx2",Atlimit,AvgEntryPrice*1.10,"",Floor(CurrentContracts*0.50),1); if Condition3 == true then ExitLong("bx3",Atlimit,AvgEntryPrice*1.15,"",Floor(CurrentContracts*0.75),1); if Condition4 == true then ExitLong("bx4",Atlimit,AvgEntryPrice*1.20); } Else { Condition1 = false; Condition2 = false; Condition3 = false; Condition4 = false; } 즐거운 하루되세요 > 이형지 님이 쓴 글입니다. > 제목 : 청산 수식 부탁드려요( 국내 주식) > 지금 사용하고 있는 분할매수 일괄 청산 수식인데요... 분할매수는 유지하고 일괄 청산을 --> 분할 청산으로 하고 있습니다. 전체 매수 금액의 평균값에서 5% 수익시 25% 청산 10% 수익시 50% 청산 15% 수익시 75% 청산 20% 수익시 100% 청산 하는 분할 매수 청산 하는 수식을 반영부탁드릴께요.. 사용하는 수식입니다. 참고로 분봉 매매입니다. 국내 주식 input : n(200),하락퍼센트(0.95),하락퍼센트률(0.05); input : p(20),MFI값(70), MFI값하락률(5); input : 전일대비하락률(0.5); input : 매매수(300),금액1(10),금액2(20),금액3(30),금액4(100),금액5(200),금액6(200),금액7(300),금액8(300); input : 일괄청산률(9); var1 = highest(H,n); var2 = mfi(P); if stime < 143000 then { if MaxEntries < 매매수 and c < var1*하락퍼센트 and var2 < MFI값 and c < o and c <= c[1]*(100-전일대비하락률)/100 Then buy("b1",OnClose,def,Floor(금액1*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률) and var2 < (MFI값- MFI값하락률) and c < o and c <= c[1]*(99.4-전일대비하락률)/100 Then buy("b2",OnClose,def,Floor(금액2*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*2) and var2 < (MFI값- MFI값하락률*2) and c < o and c <= c[1]*(100-전일대비하락률*2)/100 Then buy("b3",OnClose,def,Floor(금액3*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*3) and var2 < (MFI값- MFI값하락률*3) and c < o and c <= c[1]*( 100-전일대비하락률*3)/100 Then buy("b4",OnClose,def,Floor(금액4*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*4) and var2 < (MFI값- MFI값하락률*4) and c < o and c <= c[1]*( 100-전일대비하락률*4)/100 Then buy("b5",OnClose,def,Floor(금액5*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*5) and var2 < (MFI값- MFI값하락률*5) and c < o and c <= c[1]*( 100-전일대비하락률*5)/100 Then buy("b6",OnClose,def,Floor(금액6*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*6) and var2 < (MFI값- MFI값하락률*6) and c < o and c <= c[1]*( 100-전일대비하락률*6)/100 Then buy("b7",OnClose,def,Floor(금액6*10000/c)); if MaxEntries < 매매수 and c < var1*(하락퍼센트- 하락퍼센트률*7) and var2 < (MFI값- MFI값하락률*7) and c < o and c <= c[1]*( 100-전일대비하락률*7)/100 Then buy("b8",OnClose,def,Floor(금액6*10000/c)); ExitLong("bx",atlimit,AvgEntryPrice*(1+일괄청산률*0.01)); } Else SetStopProfittarget(0);