커뮤니티

수식 여쭤봅니다.

프로필 이미지
부자청년28
2021-02-24 23:17:56
806
글번호 146620
답변완료
안녕하세요? 1분봉에서 매매 예정입니다. 일봉상 전일 상한가 매수는! 1차매수 오늘 현재가가 전일종가 대비 -2% 일때 매수금액의 30% 매수 2차매수 오늘 현재가가 전일종가 대비 -4% 일때 매수금액의 70% 매수 매수가 일어나는 시간은 오전 10시부터 오후1시 사이 당일 1차든 2차든 3차든 매수가 일어나서 매도가 전부 일어나 다시 물량이 0 되면 당일 재매수 금지 매도는!( 매수후 상승하면 그에 따른 매도가 일어났음 좋겠고 매수후 시간이 흐르는것에 따라 오르던 내리던 일정 비율로 매도가 나갔으면 합니다) 1차매수후 5% 상승시 전체 물량의 30% 매도 7% 상승시 남은 물량의 50% 매도 9% 상승시 남은 물량 전부 매도 1차매수후 10분후 전체 물량의 30% 매도 15분후 전체 남은 물량의 50% 매도 20분후 남은 물량 전부 매도 2차매수후 5% 상승시 전체 물량의 30% 매도 7% 상승시 남은 물량의 50% 매도 9% 상승시 남은 물량 전부 매도 2차매수후 10분후 전체 물량의 30% 매도 15분후 전체 남은 물량의 50% 매도 20분후 남은 물량 전부 매도 손절은! 매수후 -10% 시 손절 청산은! 당일 15시10분 전부 매도 이상입니다. 감사합니다~
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2021-02-25 16:27:52

안녕하세요 예스스탁입니다. input : 금액(10000000),Per1(-2),Per2(-4); input : 익절1(5),익절2(7),익절3(9),손절(-10); input : 분1(10),분2(15),분3(20); var : 상한가(0), UpLimit(0),TM(0),BT(0),BE(0),BH(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 Bdate != Bdate[1] Then { Condition1 = False; if DayHigh(1) >= 상한가[1] Then Condition1 = true; } TM = TimeToMinutes(sTime); if Condition1 == true and sTime >= 100000 and sTime < 130000 Then { if ExitDate(1) != sDate and MarketPosition == 0 Then { Buy("b1",AtLimit,DayClose(1)*(1+Per1/100),Floor((금액*0.3)/min(DayClose(1)*0.98,NextBarOpen))); Buy("b2",AtLimit,DayClose(1)*(1+Per2/100),Floor((금액*0.7)/min(DayClose(1)*0.96,NextBarOpen))); } if MarketPosition == 1 and MaxEntries == 1 Then Buy("b2.",AtLimit,DayClose(1)*(1+Per2/100),Floor((금액*0.7)/min(DayClose(1)*0.96,NextBarOpen))); } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { BT = TM; BE = LatestEntryPrice(0); BH = BE; } if H > BH Then BH = H; ExitLong("bl",AtStop,BE*(1+손절/100)); if BH < BE*1.05 Then ExitLong("bp1",AtLimit,BE*(1+익절1/100),"",Floor(CurrentContracts*0.3),1); if BH < BE*1.07 Then ExitLong("bp2",AtLimit,BE*(1+익절2/100),"",Floor(CurrentContracts*0.3),1); if BH < BE*1.09 Then ExitLong("bp3",AtLimit,BE*(1+익절3/100)); if TM >= BT+분1 and TM[1] < BT+분1 Then ExitLong("bt1",OnClose,DEF,"",Floor(CurrentContracts*0.3),1); if TM >= BT+분2 and TM[1] < BT+분2 Then ExitLong("bt2",OnClose,DEF,"",Floor(CurrentContracts*0.5),1); if TM >= BT+분3 and TM[1] < BT+분3 Then ExitLong("bt3"); } SetStopEndofday(151000); 즐거운 하루되세요 > 부자청년28 님이 쓴 글입니다. > 제목 : 수식 여쭤봅니다. > 안녕하세요? 1분봉에서 매매 예정입니다. 일봉상 전일 상한가 매수는! 1차매수 오늘 현재가가 전일종가 대비 -2% 일때 매수금액의 30% 매수 2차매수 오늘 현재가가 전일종가 대비 -4% 일때 매수금액의 70% 매수 매수가 일어나는 시간은 오전 10시부터 오후1시 사이 당일 1차든 2차든 3차든 매수가 일어나서 매도가 전부 일어나 다시 물량이 0 되면 당일 재매수 금지 매도는!( 매수후 상승하면 그에 따른 매도가 일어났음 좋겠고 매수후 시간이 흐르는것에 따라 오르던 내리던 일정 비율로 매도가 나갔으면 합니다) 1차매수후 5% 상승시 전체 물량의 30% 매도 7% 상승시 남은 물량의 50% 매도 9% 상승시 남은 물량 전부 매도 1차매수후 10분후 전체 물량의 30% 매도 15분후 전체 남은 물량의 50% 매도 20분후 남은 물량 전부 매도 2차매수후 5% 상승시 전체 물량의 30% 매도 7% 상승시 남은 물량의 50% 매도 9% 상승시 남은 물량 전부 매도 2차매수후 10분후 전체 물량의 30% 매도 15분후 전체 남은 물량의 50% 매도 20분후 남은 물량 전부 매도 손절은! 매수후 -10% 시 손절 청산은! 당일 15시10분 전부 매도 이상입니다. 감사합니다~
프로필 이미지

예스스탁 예스스탁 답변

2021-02-25 16:35:42

안녕하세요 예스스탁입니다. 테스트를 위해 일부 주석처리한 부분과 시간을 변경한 부분이 있어 수정해서 다시 올려드립니다. input : 금액(10000000),Per1(-2),Per2(-4); input : 익절1(5),익절2(7),익절3(9),손절(-10); input : 분1(10),분2(15),분3(20); var : 상한가(0), UpLimit(0),TM(0),BT(0),BE(0),BH(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 Bdate != Bdate[1] Then { Condition1 = False; if DayHigh(1) >= 상한가[1] Then Condition1 = true; } TM = TimeToMinutes(sTime); if Condition1 == true and sTime >= 100000 and sTime < 130000 Then { if ExitDate(1) != sDate and MarketPosition == 0 Then { Buy("b1",AtLimit,DayClose(1)*(1+Per1/100),Floor((금액*0.3)/min(DayClose(1)*0.98,NextBarOpen))); Buy("b2",AtLimit,DayClose(1)*(1+Per2/100),Floor((금액*0.7)/min(DayClose(1)*0.96,NextBarOpen))); } if MarketPosition == 1 and MaxEntries == 1 Then Buy("b2.",AtLimit,DayClose(1)*(1+Per2/100),Floor((금액*0.7)/min(DayClose(1)*0.96,NextBarOpen))); } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { BT = TM; BE = LatestEntryPrice(0); BH = BE; } if H > BH Then BH = H; ExitLong("bl",AtStop,BE*(1+손절/100)); if BH < BE*1.05 Then ExitLong("bp1",AtLimit,BE*(1+익절1/100),"",Floor(CurrentContracts*0.3),1); if BH < BE*1.07 Then ExitLong("bp2",AtLimit,BE*(1+익절2/100),"",Floor(CurrentContracts*0.3),1); if BH < BE*1.09 Then ExitLong("bp3",AtLimit,BE*(1+익절3/100)); if TM >= BT+분1 and TM[1] < BT+분1 Then ExitLong("bt1",OnClose,DEF,"",Floor(CurrentContracts*0.3),1); if TM >= BT+분2 and TM[1] < BT+분2 Then ExitLong("bt2",OnClose,DEF,"",Floor(CurrentContracts*0.5),1); if TM >= BT+분3 and TM[1] < BT+분3 Then ExitLong("bt3"); } SetStopEndofday(151000); 즐거운 하루되세요 > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수식 여쭤봅니다. > 안녕하세요 예스스탁입니다. input : 금액(10000000),Per1(-2),Per2(-4); input : 익절1(5),익절2(7),익절3(9),손절(-10); input : 분1(10),분2(15),분3(20); var : 상한가(0), UpLimit(0),TM(0),BT(0),BE(0),BH(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 Bdate != Bdate[1] Then { Condition1 = False; if DayHigh(1) >= 상한가[1] Then Condition1 = true; } TM = TimeToMinutes(sTime); if Condition1 == true and sTime >= 100000 and sTime < 130000 Then { if ExitDate(1) != sDate and MarketPosition == 0 Then { Buy("b1",AtLimit,DayClose(1)*(1+Per1/100),Floor((금액*0.3)/min(DayClose(1)*0.98,NextBarOpen))); Buy("b2",AtLimit,DayClose(1)*(1+Per2/100),Floor((금액*0.7)/min(DayClose(1)*0.96,NextBarOpen))); } if MarketPosition == 1 and MaxEntries == 1 Then Buy("b2.",AtLimit,DayClose(1)*(1+Per2/100),Floor((금액*0.7)/min(DayClose(1)*0.96,NextBarOpen))); } if MarketPosition == 1 Then { if CurrentContracts > CurrentContracts[1] Then { BT = TM; BE = LatestEntryPrice(0); BH = BE; } if H > BH Then BH = H; ExitLong("bl",AtStop,BE*(1+손절/100)); if BH < BE*1.05 Then ExitLong("bp1",AtLimit,BE*(1+익절1/100),"",Floor(CurrentContracts*0.3),1); if BH < BE*1.07 Then ExitLong("bp2",AtLimit,BE*(1+익절2/100),"",Floor(CurrentContracts*0.3),1); if BH < BE*1.09 Then ExitLong("bp3",AtLimit,BE*(1+익절3/100)); if TM >= BT+분1 and TM[1] < BT+분1 Then ExitLong("bt1",OnClose,DEF,"",Floor(CurrentContracts*0.3),1); if TM >= BT+분2 and TM[1] < BT+분2 Then ExitLong("bt2",OnClose,DEF,"",Floor(CurrentContracts*0.5),1); if TM >= BT+분3 and TM[1] < BT+분3 Then ExitLong("bt3"); } SetStopEndofday(151000); 즐거운 하루되세요 > 부자청년28 님이 쓴 글입니다. > 제목 : 수식 여쭤봅니다. > 안녕하세요? 1분봉에서 매매 예정입니다. 일봉상 전일 상한가 매수는! 1차매수 오늘 현재가가 전일종가 대비 -2% 일때 매수금액의 30% 매수 2차매수 오늘 현재가가 전일종가 대비 -4% 일때 매수금액의 70% 매수 매수가 일어나는 시간은 오전 10시부터 오후1시 사이 당일 1차든 2차든 3차든 매수가 일어나서 매도가 전부 일어나 다시 물량이 0 되면 당일 재매수 금지 매도는!( 매수후 상승하면 그에 따른 매도가 일어났음 좋겠고 매수후 시간이 흐르는것에 따라 오르던 내리던 일정 비율로 매도가 나갔으면 합니다) 1차매수후 5% 상승시 전체 물량의 30% 매도 7% 상승시 남은 물량의 50% 매도 9% 상승시 남은 물량 전부 매도 1차매수후 10분후 전체 물량의 30% 매도 15분후 전체 남은 물량의 50% 매도 20분후 남은 물량 전부 매도 2차매수후 5% 상승시 전체 물량의 30% 매도 7% 상승시 남은 물량의 50% 매도 9% 상승시 남은 물량 전부 매도 2차매수후 10분후 전체 물량의 30% 매도 15분후 전체 남은 물량의 50% 매도 20분후 남은 물량 전부 매도 손절은! 매수후 -10% 시 손절 청산은! 당일 15시10분 전부 매도 이상입니다. 감사합니다~