커뮤니티

시스템관련입니다.

프로필 이미지
경상도강군
2012-05-24 15:56:01
267
글번호 51302
답변완료
수고가 많으십니다. input : C1(20000000),수익(1.5),추가(2),손절(2); if CodeCategory == 1 Then{ #코스피 if BasePrice < 50000 Then{ Var1 = int(int((C1*0.04)/C)/10)*10; Var2 = int(int((C1*0.06)/C)/10)*10; } Else{ Var1 = int((C1*0.04)/C); Var2 = int((C1*0.06)/C); } } if CodeCategory == 2 or CodeCategory == 8 Then{ Var1 = int((C1*0.04)/C); Var2 = int((C1*0.06)/C); } if CodeCategory == 6 Then{#옵션 Var1 = int((C1*0.04)/(C*BigPointValue)); Var2 = int((C1*0.06)/(C*BigPointValue)); } value1 = BollBandDown(20,2); if MarketPosition == 0 and CrossDown(c,value1) and (stime < 090500 or stime >= 131000) Then buy("매수1",OnClose,def,var1); if MarketPosition == 1 and (stime < 0905000 or stime >= 131000) Then{ exitlong("매도",atlimit,avgEntryPrice*(1+수익/100)); if CurrentEntries == 1 and MaxEntries == 1 Then buy("매수2",atlimit,EntryPrice*(1-(추가*1)/100),var2); 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),var2); if CurrentEntries == 4 and MaxEntries == 4 Then exitlong("손절",AtStop,EntryPrice*(1-(추가*3+손절)/100)); } if stime == 090300 Then exitlong(); #SetStopEndofday(140000); 어제 올려주신 시스템을 오후장에만 쓰려고 약간 변형했습니다. 다른건 다 표시가 돼는데 매수를 하고 오버했을경우 다음날 오전 9시3분에 전량 청산식좀 부탁드립니다. if stime == 090300 Then exitlong(); 부분을 어떻게 변경해야하나요? 전일 포지션을 다음날 9시3분에 전량 청산하는식좀 부탁드리며 그리고 이 시스템에 당일 총 매매중 손절이 5회 이상 발생시 시스템종료식도 부탁드리겠습니다. 그럼 즐거운 하루 되십시오.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2012-05-24 17:03:07

안녕하세요 예스스탁입니다. input : C1(20000000),수익(1.5),추가(2),손절(2); var : loss(0),cnt(0); if CodeCategory == 1 Then{ #코스피 if BasePrice < 50000 Then{ Var1 = int(int((C1*0.04)/C)/10)*10; Var2 = int(int((C1*0.06)/C)/10)*10; } Else{ Var1 = int((C1*0.04)/C); Var2 = int((C1*0.06)/C); } } if CodeCategory == 2 or CodeCategory == 8 Then{ Var1 = int((C1*0.04)/C); Var2 = int((C1*0.06)/C); } if CodeCategory == 6 Then{#옵션 Var1 = int((C1*0.04)/(C*BigPointValue)); Var2 = int((C1*0.06)/(C*BigPointValue)); } #당일 "손절"이름으로 청산된 횟수 loss = 0; for cnt = 0 to 20{ if exitdate(cnt) == sdate and IsExitName("손절",cnt) == true Then loss = loss+1; } value1 = BollBandDown(20,2); if MarketPosition == 0 and loss < 5 and CrossDown(c,value1) and (stime < 090500 or stime >= 131000) Then buy("매수1",OnClose,def,var1); if MarketPosition == 1 and (stime < 0905000 or stime >= 131000) Then{ exitlong("매도",atlimit,avgEntryPrice*(1+수익/100)); if CurrentEntries == 1 and MaxEntries == 1 Then buy("매수2",atlimit,EntryPrice*(1-(추가*1)/100),var2); 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),var2); if CurrentEntries == 4 and MaxEntries == 4 Then exitlong("손절",AtStop,EntryPrice*(1-(추가*3+손절)/100)); } #이전일에 매수했으면 당일 9시 3분봉완성시 청산 if EntryDate != sdate and stime == 090300 Then exitlong(); #SetStopEndofday(140000); 즐거운 하루되세요 > 경상도강군 님이 쓴 글입니다. > 제목 : 시스템관련입니다. > 수고가 많으십니다. input : C1(20000000),수익(1.5),추가(2),손절(2); if CodeCategory == 1 Then{ #코스피 if BasePrice < 50000 Then{ Var1 = int(int((C1*0.04)/C)/10)*10; Var2 = int(int((C1*0.06)/C)/10)*10; } Else{ Var1 = int((C1*0.04)/C); Var2 = int((C1*0.06)/C); } } if CodeCategory == 2 or CodeCategory == 8 Then{ Var1 = int((C1*0.04)/C); Var2 = int((C1*0.06)/C); } if CodeCategory == 6 Then{#옵션 Var1 = int((C1*0.04)/(C*BigPointValue)); Var2 = int((C1*0.06)/(C*BigPointValue)); } value1 = BollBandDown(20,2); if MarketPosition == 0 and CrossDown(c,value1) and (stime < 090500 or stime >= 131000) Then buy("매수1",OnClose,def,var1); if MarketPosition == 1 and (stime < 0905000 or stime >= 131000) Then{ exitlong("매도",atlimit,avgEntryPrice*(1+수익/100)); if CurrentEntries == 1 and MaxEntries == 1 Then buy("매수2",atlimit,EntryPrice*(1-(추가*1)/100),var2); 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),var2); if CurrentEntries == 4 and MaxEntries == 4 Then exitlong("손절",AtStop,EntryPrice*(1-(추가*3+손절)/100)); } if stime == 090300 Then exitlong(); #SetStopEndofday(140000); 어제 올려주신 시스템을 오후장에만 쓰려고 약간 변형했습니다. 다른건 다 표시가 돼는데 매수를 하고 오버했을경우 다음날 오전 9시3분에 전량 청산식좀 부탁드립니다. if stime == 090300 Then exitlong(); 부분을 어떻게 변경해야하나요? 전일 포지션을 다음날 9시3분에 전량 청산하는식좀 부탁드리며 그리고 이 시스템에 당일 총 매매중 손절이 5회 이상 발생시 시스템종료식도 부탁드리겠습니다. 그럼 즐거운 하루 되십시오.