커뮤니티

또다른 수식 질문드립니다.

프로필 이미지
부자청년28
2019-07-06 23:51:42
222
글번호 130109
답변완료
안녕하세요? 1분봉 차트에서 매매하려고 하구요 금액은 변수로 설정가능하도록 하고 싶습니다. 매수는 2일전 일봉상 양봉 1일전 일봉상 양봉 이면서 15시10분에 일봉상 차트가 상한가가 아닌 양봉일때 매수! 매도는 매수일+1일 오전10시30분에 물량의 20% 매수일+2일 오전10시30분에 물량의 25% 매수일+3일 오전10시30분에 물량의 33% 매수일+4일 오전10시30분에 물량의 50% 매수일+5일 오전10시30분에 전체 매도 매수후 +10% 달성시 남은 물량의 30% 매도 +20% 달성시 남은 물량의 50% 매도 +30% 달성시 전체 매도 손절은 -15% 달성시 50% 매도 -30% 달성시 전체 매도 입니다. 감사합니다~
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2019-07-08 10:57:52

안녕하세요 예스스탁입니다. input : 금액(10000000); var : 상한가(0), UpLimit(0),count(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 MarketPosition == 0 and stime >= 151000 and stime[1] < 151000 and DayClose(1) > dayopen(1) and DayClose(2) > dayopen(2) and DayClose(0) > dayopen(0) and DayHigh < 상한가 then buy("b",OnClose,def,Floor(금액/c)); if MarketPosition == 1 Then { if sdate > EntryDate and stime >= 103000 and stime[1] < 103000 Then { count = count+1; if count == 1 Then ExitLong("bx1",OnClose,def,"",floor(CurrentContracts*0.20),1); if count == 2 Then ExitLong("bx2",OnClose,def,"",floor(CurrentContracts*0.25),1); if count == 3 Then ExitLong("bx3",OnClose,def,"",floor(CurrentContracts*0.35),1); if count == 4 Then ExitLong("bx4",OnClose,def,"",floor(CurrentContracts*0.50),1); if count == 5 Then ExitLong("bx5"); } ExitLong("bp1",atlimit,EntryPrice*1.10,"",Floor(CurrentContracts*0.30),1); ExitLong("bp2",atlimit,EntryPrice*1.20,"",Floor(CurrentContracts*0.50),1); ExitLong("bp3",atlimit,EntryPrice*1.30); ExitLong("bl1",AtStop,EntryPrice*0.15,"",Floor(CurrentContracts*0.50),1); ExitLong("bl2",AtStop,EntryPrice*0.70); } Else count = 0; 즐거운 하루되세요 > 부자청년28 님이 쓴 글입니다. > 제목 : 또다른 수식 질문드립니다. > 안녕하세요? 1분봉 차트에서 매매하려고 하구요 금액은 변수로 설정가능하도록 하고 싶습니다. 매수는 2일전 일봉상 양봉 1일전 일봉상 양봉 이면서 15시10분에 일봉상 차트가 상한가가 아닌 양봉일때 매수! 매도는 매수일+1일 오전10시30분에 물량의 20% 매수일+2일 오전10시30분에 물량의 25% 매수일+3일 오전10시30분에 물량의 33% 매수일+4일 오전10시30분에 물량의 50% 매수일+5일 오전10시30분에 전체 매도 매수후 +10% 달성시 남은 물량의 30% 매도 +20% 달성시 남은 물량의 50% 매도 +30% 달성시 전체 매도 손절은 -15% 달성시 50% 매도 -30% 달성시 전체 매도 입니다. 감사합니다~