커뮤니티

시스템식 문의

프로필 이미지
경상도강군
2013-01-24 20:10:57
232
글번호 58632
답변완료
2013년 새해복 많이 받으세요. 1. A라는 시스템이 있을경우 현재 주가가 5이평선 아래에 있을경우에만 신호가 나오게끔 하는 방법을 알고싶습니다. 2.3일전에 종가가 상한가 마감했을경우 5이평선 아래에서만 시스템 신호가 나오게끔 하는 방법도 가능할까요? 아래식에 넣고 싶습니다. 두가지식을 따로 부탁드립니다 input : C1(18000000),수익(8),추가(2),손절(2); var : loss(0),cnt(0); if CodeCategory == 1 Then{ #코스피 if BasePrice < 50000 Then{ Var1 = int(int((C1*0.08)/C)/10)*10; Var2 = int(int((C1*0.1)/C)/10)*10; } Else{ Var1 = int((C1*0.08)/C); Var2 = int((C1*0.1)/C); } } if CodeCategory == 2 or CodeCategory == 8 Then{ Var1 = int((C1*0.08)/C); Var2 = int((C1*0.1)/C); } if CodeCategory == 6 Then{#옵션 Var1 = int((C1*0.08)/(C*BigPointValue)); Var2 = int((C1*0.1)/(C*BigPointValue)); } #당일 "손절"이름으로 청산된 횟수 loss = 0; for cnt = 0 to 20{ if exitdate(cnt) == sdate and IsExitName("손절",cnt) == true Then loss = loss+1; } value1 = BollBandDown(20,6); if MarketPosition == 0 and loss < 5 and CrossDown(c,value1) and (stime < 090000 or stime >= 133000) Then buy("매수1",OnClose,def,var2); if MarketPosition == 1 and (stime < 090000 or stime >= 133000) Then{ exitlong("매도",atlimit,avgEntryPrice*(1+수익/100)); if CurrentEntries == 1 and MaxEntries == 1 Then buy("매수2",atlimit,EntryPrice*(1-(추가*1)/100),var1); if CurrentEntries == 2 and MaxEntries == 2 Then buy("매수3",atlimit,EntryPrice*(1-(추가*2)/100),var1); if CurrentEntries == 3 and MaxEntries == 3 Then buy("매수4",atlimit,EntryPrice*(1-(추가*3)/100),var1); if CurrentEntries == 4 and MaxEntries == 4 Then exitlong("손절",AtStop,EntryPrice*(1-(추가*3+손절)/100)); } #이전일에 매수했으면 당일 9시 9분봉완성시 청산 if EntryDate != sdate and stime == 090900 Then exitlong(); #SetStopEndofday(140000);
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-01-25 09:38:13

안녕하세요 예스스탁입니다. 1. input : C1(18000000),수익(8),추가(2),손절(2); var : loss(0),cnt(0),mav(0); mav = ma(c,5); if CodeCategory == 1 Then{ #코스피 if BasePrice < 50000 Then{ Var1 = int(int((C1*0.08)/C)/10)*10; Var2 = int(int((C1*0.1)/C)/10)*10; } Else{ Var1 = int((C1*0.08)/C); Var2 = int((C1*0.1)/C); } } if CodeCategory == 2 or CodeCategory == 8 Then{ Var1 = int((C1*0.08)/C); Var2 = int((C1*0.1)/C); } if CodeCategory == 6 Then{#옵션 Var1 = int((C1*0.08)/(C*BigPointValue)); Var2 = int((C1*0.1)/(C*BigPointValue)); } #당일 "손절"이름으로 청산된 횟수 loss = 0; for cnt = 0 to 20{ if exitdate(cnt) == sdate and IsExitName("손절",cnt) == true Then loss = loss+1; } value1 = BollBandDown(20,6); if C < mav Then{ if MarketPosition == 0 and loss < 5 and CrossDown(c,value1) and (stime < 090000 or stime >= 133000) Then buy("매수1",OnClose,def,var2); if MarketPosition == 1 and (stime < 090000 or stime >= 133000) Then{ exitlong("매도",atlimit,avgEntryPrice*(1+수익/100)); if CurrentEntries == 1 and MaxEntries == 1 Then buy("매수2",atlimit,EntryPrice*(1-(추가*1)/100),var1); if CurrentEntries == 2 and MaxEntries == 2 Then buy("매수3",atlimit,EntryPrice*(1-(추가*2)/100),var1); if CurrentEntries == 3 and MaxEntries == 3 Then buy("매수4",atlimit,EntryPrice*(1-(추가*3)/100),var1); if CurrentEntries == 4 and MaxEntries == 4 Then exitlong("손절",AtStop,EntryPrice*(1-(추가*3+손절)/100)); } } #이전일에 매수했으면 당일 9시 9분봉완성시 청산 if EntryDate != sdate and stime == 090900 Then exitlong(); #SetStopEndofday(140000); 2. input : C1(18000000),수익(8),추가(2),손절(2); var : loss(0),cnt(0),mav(0); var : 상한가(0),상한가1(0),상한가2(0),상한가3(0), UpLimit(0),up1(0), up2(0), up3(0), up4(0), up5(0),up6(0); if date >= 19981207 then { if date < 20050328 && CodeCategory() == 2 then UpLimit = (BP[0] * 1.12); Else UpLimit = (BP[0] * 1.15); 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; } 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; } } 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; } if CodeCategory() == 1 || CodeCategory() == 2 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 상한가 = iff(up6>=5000, up5, up6); } else if CodeCategory() == 8 || CodeCategory() == 9 then { // ETF 상한가 = up6; } } if date != date[1] Then{ 상한가1 = 상한가[1]; 상한가2 = 상한가1[1]; 상한가3 = 상한가2[1];#3일전 상한가 } mav = ma(c,5); if CodeCategory == 1 Then{ #코스피 if BasePrice < 50000 Then{ Var1 = int(int((C1*0.08)/C)/10)*10; Var2 = int(int((C1*0.1)/C)/10)*10; } Else{ Var1 = int((C1*0.08)/C); Var2 = int((C1*0.1)/C); } } if CodeCategory == 2 or CodeCategory == 8 Then{ Var1 = int((C1*0.08)/C); Var2 = int((C1*0.1)/C); } if CodeCategory == 6 Then{#옵션 Var1 = int((C1*0.08)/(C*BigPointValue)); Var2 = int((C1*0.1)/(C*BigPointValue)); } #당일 "손절"이름으로 청산된 횟수 loss = 0; for cnt = 0 to 20{ if exitdate(cnt) == sdate and IsExitName("손절",cnt) == true Then loss = loss+1; } value1 = BollBandDown(20,6); if DayClose(3) < 상한가3 or (DayClose(3) >= 상한가3 and C < ma(c,5)) Then{ if MarketPosition == 0 and loss < 5 and c < mav and CrossDown(c,value1) and (stime < 090000 or stime >= 133000) Then buy("매수1",OnClose,def,var2); if MarketPosition == 1 and (stime < 090000 or stime >= 133000) and c < mav Then{ exitlong("매도",atlimit,avgEntryPrice*(1+수익/100)); if CurrentEntries == 1 and MaxEntries == 1 Then buy("매수2",atlimit,EntryPrice*(1-(추가*1)/100),var1); if CurrentEntries == 2 and MaxEntries == 2 Then buy("매수3",atlimit,EntryPrice*(1-(추가*2)/100),var1); if CurrentEntries == 3 and MaxEntries == 3 Then buy("매수4",atlimit,EntryPrice*(1-(추가*3)/100),var1); if CurrentEntries == 4 and MaxEntries == 4 Then exitlong("손절",AtStop,EntryPrice*(1-(추가*3+손절)/100)); } } #이전일에 매수했으면 당일 9시 9분봉완성시 청산 if EntryDate != sdate and stime == 090900 Then exitlong(); #SetStopEndofday(140000); 즐거운 하루되세요 > 경상도강군 님이 쓴 글입니다. > 제목 : 시스템식 문의 > 2013년 새해복 많이 받으세요. 1. A라는 시스템이 있을경우 현재 주가가 5이평선 아래에 있을경우에만 신호가 나오게끔 하는 방법을 알고싶습니다. 2.3일전에 종가가 상한가 마감했을경우 5이평선 아래에서만 시스템 신호가 나오게끔 하는 방법도 가능할까요? 아래식에 넣고 싶습니다. 두가지식을 따로 부탁드립니다 input : C1(18000000),수익(8),추가(2),손절(2); var : loss(0),cnt(0); if CodeCategory == 1 Then{ #코스피 if BasePrice < 50000 Then{ Var1 = int(int((C1*0.08)/C)/10)*10; Var2 = int(int((C1*0.1)/C)/10)*10; } Else{ Var1 = int((C1*0.08)/C); Var2 = int((C1*0.1)/C); } } if CodeCategory == 2 or CodeCategory == 8 Then{ Var1 = int((C1*0.08)/C); Var2 = int((C1*0.1)/C); } if CodeCategory == 6 Then{#옵션 Var1 = int((C1*0.08)/(C*BigPointValue)); Var2 = int((C1*0.1)/(C*BigPointValue)); } #당일 "손절"이름으로 청산된 횟수 loss = 0; for cnt = 0 to 20{ if exitdate(cnt) == sdate and IsExitName("손절",cnt) == true Then loss = loss+1; } value1 = BollBandDown(20,6); if MarketPosition == 0 and loss < 5 and CrossDown(c,value1) and (stime < 090000 or stime >= 133000) Then buy("매수1",OnClose,def,var2); if MarketPosition == 1 and (stime < 090000 or stime >= 133000) Then{ exitlong("매도",atlimit,avgEntryPrice*(1+수익/100)); if CurrentEntries == 1 and MaxEntries == 1 Then buy("매수2",atlimit,EntryPrice*(1-(추가*1)/100),var1); if CurrentEntries == 2 and MaxEntries == 2 Then buy("매수3",atlimit,EntryPrice*(1-(추가*2)/100),var1); if CurrentEntries == 3 and MaxEntries == 3 Then buy("매수4",atlimit,EntryPrice*(1-(추가*3)/100),var1); if CurrentEntries == 4 and MaxEntries == 4 Then exitlong("손절",AtStop,EntryPrice*(1-(추가*3+손절)/100)); } #이전일에 매수했으면 당일 9시 9분봉완성시 청산 if EntryDate != sdate and stime == 090900 Then exitlong(); #SetStopEndofday(140000);