커뮤니티

시스템식 추가질문 드립니다~

프로필 이미지
메디사
2016-06-15 17:47:56
100
글번호 99115
답변완료
# 해당식에서 1.매수가 대비 3%시 절반 매도후 잔량 최대수익대비 30%하락시 전량매도 추가 2.매수조건에 스토케스틱 K인지 D인지 모르겠지만 그게 30이상일때 조건 추가 3.상한가일때 매도금지가 되어있는지 다시 확인부탁 매번 감사합니다~^^& Input : Period(20),short(12),long(26),금액(1000000),수익(3),손실(1),횟수제한(5); var : VRatio(0),MACDV(0),Bcond(false); var : cnt(0),count(0); VRatio = VR(Period); MACDV = MACD(short,long); Bcond = Vratio > 100 and MACDV > 0; count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } if count == 0 and MarketPosition == 0 and Bcond == true and Bcond[1] == false Then buy("b",OnClose,def,int(금액/C)); if count > 0 and count < 횟수제한 and MarketPosition == 0 and VRatio > 100 and crossup(MACDv,0) Then buy("bb",OnClose,def,int(금액/C)); if MarketPosition == 1 Then{ ExitLong("bp",atlimit,AvgEntryPrice*(1+수익/100),"",Floor(MaxContracts*0.5),1); ExitLong("bl",AtStop,AvgEntryPrice*(1-손실/100)); if CrossDown(MACDV,0) Then exitlong("bx1"); } SetStopEndofday(143000); > 메디사 님이 쓴 글입니다. > 제목 : 시스템식 부탁드립니다~ > 먼저 항상 도움주셔서 감사합니다~^^& 1회매수시 금액(100만원)도 변경할수있게 해주세요^^ # 매수 전략 1. VR RATIO가 100이상일때 MACD가 0을 크로스업 할때 2. MACD가 0이상이고 VR RATIO가 100을 크로스업 할때 # 추격매수 전략 1. 첫 매수이후 MACD가 계속 0이상이고 VR RATIORK 100을 크로스업 할때 (횟수제한:최대5회) # 매도 전략 1. 매수가 대비 +3%이상 일때 절반 매도 2. 매수가 대비 -1%이하 일때 전량 매도 3. MACD가 0을 크로스다운 할때 전량 매도 4. 매수이후 2시40분초과시 전량 매도(단, 상한가일때 매수유지) 수치화 되는 부분은 전부 변수화 시켜주시면 감사하겠습니다~
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2016-06-16 12:41:58

안녕하세요 예스스탁입니다. 상한가가 아닐때만 14시 30분에 청산하게 수정했습니다. 1번,2번도 반영한 식입니다. Input : Period(20),short(12),long(26),금액(1000000),수익(3),손실(1),횟수제한(5); input : sto1(10),sto2(5); var : VRatio(0),MACDV(0),Bcond(false); var : cnt(0),count(0),stok(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 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; } } VRatio = VR(Period); MACDV = MACD(short,long); stok = StochasticsK(sto1,sto2); Bcond = Vratio > 100 and MACDV > 0 and stok >= 30; count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } if count == 0 and MarketPosition == 0 and Bcond == true and Bcond[1] == false Then buy("b",OnClose,def,int(금액/C)); if count > 0 and count < 횟수제한 and MarketPosition == 0 and VRatio > 100 and stok >= 30 and crossup(MACDv,0) Then buy("bb",OnClose,def,int(금액/C)); if MarketPosition == 1 Then{ ExitLong("bl",AtStop,AvgEntryPrice*(1-손실/100)); if CurrentContracts == MaxContracts Then ExitLong("bp",atlimit,AvgEntryPrice*(1+수익/100),"",Floor(MaxContracts*0.5),1); if CurrentContracts < MaxContracts Then ExitLong("btr",AtStop,highest(h,BarsSinceEntry)-(highest(H,BarsSinceEntry)-EntryPrice)*0.3); if CrossDown(MACDV,0) Then exitlong("bx1"); if stime == 143000 and C < 상한가 Then exitlong(); } 즐거운 하루되세요 > 메디사 님이 쓴 글입니다. > 제목 : 시스템식 추가질문 드립니다~ > # 해당식에서 1.매수가 대비 3%시 절반 매도후 잔량 최대수익대비 30%하락시 전량매도 추가 2.매수조건에 스토케스틱 K인지 D인지 모르겠지만 그게 30이상일때 조건 추가 3.상한가일때 매도금지가 되어있는지 다시 확인부탁 매번 감사합니다~^^& Input : Period(20),short(12),long(26),금액(1000000),수익(3),손실(1),횟수제한(5); var : VRatio(0),MACDV(0),Bcond(false); var : cnt(0),count(0); VRatio = VR(Period); MACDV = MACD(short,long); Bcond = Vratio > 100 and MACDV > 0; count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } if count == 0 and MarketPosition == 0 and Bcond == true and Bcond[1] == false Then buy("b",OnClose,def,int(금액/C)); if count > 0 and count < 횟수제한 and MarketPosition == 0 and VRatio > 100 and crossup(MACDv,0) Then buy("bb",OnClose,def,int(금액/C)); if MarketPosition == 1 Then{ ExitLong("bp",atlimit,AvgEntryPrice*(1+수익/100),"",Floor(MaxContracts*0.5),1); ExitLong("bl",AtStop,AvgEntryPrice*(1-손실/100)); if CrossDown(MACDV,0) Then exitlong("bx1"); } SetStopEndofday(143000); > 메디사 님이 쓴 글입니다. > 제목 : 시스템식 부탁드립니다~ > 먼저 항상 도움주셔서 감사합니다~^^& 1회매수시 금액(100만원)도 변경할수있게 해주세요^^ # 매수 전략 1. VR RATIO가 100이상일때 MACD가 0을 크로스업 할때 2. MACD가 0이상이고 VR RATIO가 100을 크로스업 할때 # 추격매수 전략 1. 첫 매수이후 MACD가 계속 0이상이고 VR RATIORK 100을 크로스업 할때 (횟수제한:최대5회) # 매도 전략 1. 매수가 대비 +3%이상 일때 절반 매도 2. 매수가 대비 -1%이하 일때 전량 매도 3. MACD가 0을 크로스다운 할때 전량 매도 4. 매수이후 2시40분초과시 전량 매도(단, 상한가일때 매수유지) 수치화 되는 부분은 전부 변수화 시켜주시면 감사하겠습니다~