커뮤니티

시스템 수식 부탁드립니다.

프로필 이미지
승부사1
2015-06-21 10:52:40
112
글번호 87445
답변완료
1. 전일종가보다 시초가가 높은경우에만 시초가 매수 (설정창의 비용수량에 입력하는 금액의 50%) 2. 주가를 30분 단위로 체크하여 시초가보다 낮은 경우에 매수 (설정창의 비용수량에 입력하는 금액의 50%) - 이때 진입회수는 2회로 설정해야하는 건지 궁금합니다. 3. 상한가 도달시 전량 매도 4. 종가 전량 매도 5. 손절: 전일 저가 -1% 또는 350MA 하향이탈시
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-06-22 13:14:35

안녕하세요 예스스탁입니다. 1. 비용수량탭에 적혀진 금액은 수식에서 인지가 가능하지 않습니다. 식의 외부변수로 처리해 드립니다. 2, 시초가에 신호를 내기 위해서는 전일마지막봉에서 if문 만족시켜서 봉완성시점인 다음날 시초가수신될때 신호가 발생하게 해야 합니다. 사용시는 차트주기별로 마지막봉 시간이 다릅니다. 올려주신 내용은 30분차트에 적용되어야 하는 내용이므로 15시로 지정했습니다. 1회 추가진입을 해야하므로 시스템 적용시 피라미딩탭에서 피라미딩을 다른진입신호만 허용으로 설정하고 적용하시기 바랍니다. input : 금액(10000000); var : 하한가(0), DnLimit(0); var : dn1(0), dn2(0), dn3(0), dn4(0), dn5(0),dn6(0),dn7(0); var : 상한가(0), UpLimit(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 DnLimit = (BP * 0.12); Else if date >= 20050328 and date < 20150615 Then DnLimit = (BP * 0.15); Else DnLimit = (BP * 0.30); if CodeCategory() == 2 then { if date >= 20030721 then { dn1 = int(DnLimit/100)*100; dn2 = int(DnLimit/100)*100; dn3 = int(DnLimit/100)*100; dn4 = int(DnLimit/50)*50; dn5 = int(DnLimit/10)*10; dn6 = int(DnLimit/5)*5; dn7 = int(DnLimit/1)*1; } else { dn1 = int(DnLimit/1000)*1000; dn2 = int(DnLimit/500)*500; dn3 = int(DnLimit/100)*100; dn4 = int(DnLimit/50)*50; dn5 = int(DnLimit/10)*10; dn6 = int(DnLimit/10)*10; dn7 = int(DnLimit/1)*1; } } Else { dn1 = int(DnLimit/1000)*1000; dn2 = int(DnLimit/500)*500; dn3 = int(DnLimit/100)*100; dn4 = int(DnLimit/50)*50; dn5 = int(DnLimit/10)*10; dn6 = int(DnLimit/5)*5; dn7 = int(DnLimit/1)*1; } if CodeCategory() == 1 or CodeCategory() == 2 then { if sdate < 20101004 Then{ If BP >= 500000 Then 하한가 = BP-dn1; Else If BP >= 100000 Then 하한가 = BP-dn2; Else If BP >= 50000 Then 하한가 = BP-dn3; Else If BP >= 10000 Then 하한가 = BP-dn4; Else If BP >= 5000 Then 하한가 = BP-dn5; Else If BP >= 1000 Then 하한가 = BP-dn6; Else 하한가 = BP-dn6; } else{ If BP >= 500000 Then 하한가 = BP-dn1; Else If BP >= 100000 Then 하한가 = BP-dn2; Else If BP >= 50000 Then 하한가 = BP-dn3; Else If BP >= 10000 Then 하한가 = BP-dn4; Else If BP >= 5000 Then 하한가 = BP-dn5; Else If BP >= 1000 Then 하한가 = BP-dn6; Else 하한가 = BP-dn7; } } else if CodeCategory() == 8 or CodeCategory() == 9 then { 하한가 = BP-dn6; } } 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 stime == 150000 and NextBarOpen > C Then buy("b",AtMarket,def,int((금액/NextBarOpen)*0.5)); var1 = ma(C,350); if MarketPosition == 1 Then{ if MaxEntries == 1 and C < dayopen Then buy("b2",OnClose,def,int((금액/NextBarOpen)*0.5)); ExitLong("bl",AtStop,daylow(1)*0.99); ExitLong("bp",Atlimit,상한가); if CrossDown(c,var1) Then exitlong("bx2"); } SetStopEndofday(150000); 즐거운 하루되세요 > 승부사1 님이 쓴 글입니다. > 제목 : 시스템 수식 부탁드립니다. > 1. 전일종가보다 시초가가 높은경우에만 시초가 매수 (설정창의 비용수량에 입력하는 금액의 50%) 2. 주가를 30분 단위로 체크하여 시초가보다 낮은 경우에 매수 (설정창의 비용수량에 입력하는 금액의 50%) - 이때 진입회수는 2회로 설정해야하는 건지 궁금합니다. 3. 상한가 도달시 전량 매도 4. 종가 전량 매도 5. 손절: 전일 저가 -1% 또는 350MA 하향이탈시