커뮤니티

시스템 여쭤봅니다~

프로필 이미지
부자청년28
2021-03-26 07:57:06
969
글번호 147411
답변완료
15봉이내 상한가 발생시 가장 최근 발생 상한가 종가 기준으로 매매가 이뤄졌으면합니다. 시스템은 분봉에 적용예정입니다. * 매수 1차매수 :: 그 상한가 종가에서 -10% 하락시 매수 금액의 40%매수 2차매수 :: 그 상한가 종가에서 -15% 하락시 매수 금액의 60%매수 * 매도 1차매수든 2차매수든 이뤄지면 7% 상승시 가진물량의 30%매도 10% 상승시 가진물량의 50%매도 15% 상승시 남은물량전부 매도 ------------------------------------------------------------ 또한 매수 시점부터 3시간 정도 마다 남은 물량의 10%씩 매도 1차 매수후 매도든 손절이든 전부 이뤄져 가진물량이 0이되면 1차든 2차든 재매수 금지 1차 , 2차 매수후 매도든 손절이든 전부 이뤄져 가진물량이 0이 되면 당일 재매수 금지 ----------------------------------------------------------- 1차매수후 매도가 이뤄지고 있어도 물량이 남아있음 2차매수 가능! ------------------------------------------------ *손절은 -5%면 60% -9%면 나머지 전부 이상입니다. 감사합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2021-03-26 14:36:27

안녕하세요 예스스탁입니다. input : 매수금액(10000000); var : 상한가(0), UpLimit(0),entry(0),TM(0),ET(0); var : up1(0), up2(0), up3(0), up4(0), up5(0),up6(0),Up7(0); if date >= 19981207 then { if date < 20050328 && CodeCategory() == 2 then UpLimit = (BP[0] * 1.12); Else if date >= 20050328 and date < 20150615 Then UpLimit = (BP[0] * 1.15); Else UpLimit = (BP[0] * 1.30); if CodeCategory() == 2 then { if date >= 20030721 then { up1 = int(UpLimit/100+0.00001)*100; up2 = int(UpLimit/100+0.00001)*100; up3 = int(UpLimit/100+0.00001)*100; up4 = int(UpLimit/50+0.00001)*50; up5 = int(UpLimit/10+0.00001)*10; up6 = int(UpLimit/5+0.00001)*5; up7 = int(UpLimit/1+0.00001)*1; } else { up1 = int(UpLimit/1000+0.00001)*1000; up2 = int(UpLimit/500+0.00001)*500; up3 = int(UpLimit/100+0.00001)*100; up4 = int(UpLimit/50+0.00001)*50; up5 = int(UpLimit/10+0.00001)*10; up6 = int(UpLimit/10+0.00001)*10; up7 = int(UpLimit/1+0.00001)*1; } } Else { up1 = int(UpLimit/1000+0.00001)*1000; up2 = int(UpLimit/500+0.00001)*500; up3 = int(UpLimit/100+0.00001)*100; up4 = int(UpLimit/50+0.00001)*50; up5 = int(UpLimit/10+0.00001)*10; up6 = int(UpLimit/5+0.00001)*5; up7 = int(UpLimit/1+0.00001)*1; } if CodeCategory() == 1 || CodeCategory() == 2 then { if sdate < 20101004 Then { If BP >= 500000 Then 상한가 = up1; Else If BP >= 100000 Then 상한가 = iff(up2>=500000, up1, up2); Else If BP >= 50000 Then 상한가 = iff(up3>=100000, up2, up3); Else If BP >= 10000 Then 상한가 = iff(up4>=50000, up3, up4); Else If BP >= 5000 Then 상한가 = iff(up5>=10000, up4, up5); Else If BP >= 1000 Then 상한가 = iff(up5>=5000, up5, up6); Else 상한가 = iff(up6>=1000, up6, up6); } Else { If BP >= 500000 Then 상한가 = up1; Else If BP >= 100000 Then 상한가 = iff(up2>=500000, up1, up2); Else If BP >= 50000 Then 상한가 = iff(up3>=100000, up2, up3); Else If BP >= 10000 Then 상한가 = iff(up4>=50000, up3, up4); Else If BP >= 5000 Then 상한가 = iff(up5>=10000, up4, up5); Else If BP >= 1000 Then 상한가 = iff(up5>=5000, up5, up6); Else 상한가 = iff(up6>=1000, up6, up7); } } else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF 상한가 = up6; } } if C >= 상한가 Then var1 = C; TM = TimeToMinutes(sTime); if bdate != bdate[1] Then entry = 0; if (MarketPosition != 0 and MarketPosition != MarketPosition[1]) or (MarketPosition == MarketPosition and TotalTrades > TotalTrades[1]) Then entry = entry+1; if CountIf(C>=상한가,15) >= 1 Then { if MarketPosition == 0 and entry < 1 Then Buy("b1",AtLimit,var1*0.90,Floor((매수금액*0.4)/min(NextBarOpen,var1*0.90))); if MarketPosition == 1 and MaxEntries == 1 Then Buy("b2",AtLimit,var1*0.85,Floor((매수금액*0.4)/min(NextBarOpen,var1*0.85))); } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { ET = TM; Condition1 = False; Condition2 = False; Condition3 = False; Condition4 = False; Condition5 = False; } if CurrentContracts < CurrentContracts[1] Then { if LatestExitName(0) == "bx1" Then Condition1 = true; if LatestExitName(0) == "bx2" Then Condition1 = False; if LatestExitName(0) == "bx3" Then Condition1 = False; if LatestExitName(0) == "bl1" Then Condition4 = true; if LatestExitName(0) == "bl2" Then Condition5 = False; } if Condition1 == False Then ExitLong("bx1",AtLimit,AvgEntryPrice*1.07,"",Floor(CurrentContracts*0.3),1); if Condition1 == False Then ExitLong("bx2",AtLimit,AvgEntryPrice*1.10,"",Floor(CurrentContracts*0.5),1); if Condition1 == False Then ExitLong("bx3",AtLimit,AvgEntryPrice*1.15); if MaxEntries == 2 and Condition4 == False Then ExitLong("bl1",AtStop,AvgEntryPrice*0.95,"",Floor(CurrentContracts*0.6),1); if MaxEntries == 2 and Condition5 == False Then ExitLong("bl2",AtStop, AvgEntryPrice*0.91); if TM >= ET+180 and TM[1] < ET+180 Then ExitLong("bx",OnClose,DEF,"",Floor(CurrentContracts*0.1),1); } 즐거운 하루되세요 > 부자청년28 님이 쓴 글입니다. > 제목 : 시스템 여쭤봅니다~ > 15봉이내 상한가 발생시 가장 최근 발생 상한가 종가 기준으로 매매가 이뤄졌으면합니다. 시스템은 분봉에 적용예정입니다. * 매수 1차매수 :: 그 상한가 종가에서 -10% 하락시 매수 금액의 40%매수 2차매수 :: 그 상한가 종가에서 -15% 하락시 매수 금액의 60%매수 * 매도 1차매수든 2차매수든 이뤄지면 7% 상승시 가진물량의 30%매도 10% 상승시 가진물량의 50%매도 15% 상승시 남은물량전부 매도 ------------------------------------------------------------ 또한 매수 시점부터 3시간 정도 마다 남은 물량의 10%씩 매도 1차 매수후 매도든 손절이든 전부 이뤄져 가진물량이 0이되면 1차든 2차든 재매수 금지 1차 , 2차 매수후 매도든 손절이든 전부 이뤄져 가진물량이 0이 되면 당일 재매수 금지 ----------------------------------------------------------- 1차매수후 매도가 이뤄지고 있어도 물량이 남아있음 2차매수 가능! ------------------------------------------------ *손절은 -5%면 60% -9%면 나머지 전부 이상입니다. 감사합니다.