커뮤니티

수정 부탁드립니다.

프로필 이미지
영산강
2015-06-30 16:56:18
124
글번호 87823
답변완료
주챠트는5분봉이고 30분봉을 참조해서 진입하고 청산은 주챠트5분봉에서 할려구 하는데 잘안돼네요. 자료첨부하오니 수식수정 부탁합니다.
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2015-06-30 18:39:43

안녕하세요 예스스탁입니다. 청산을 제외하고 모두 data2에서 조건으로 변경했습니다. 참조데이터로 30분 차트 추가하시고 적용하시면 됩니다. input :P1(11), P2(6), P3(6) ,mm1(5),mm2(6),mm3(45),sm(9),ss(7),pb(0.7),ps(0.8),k1(74),k2(41),LL(47),Hw(49),capital(2000),구분(1); var : slowK(0,data2), slowD(0,data2), CroUp(false,data2),DParity(0,data2), CroDn(False,data2), Con1(0,data2), Con2(0,data2); var : cnt(0,data2),count(0,data2),va1(0,data2),va2(0,data2),va3(0,data2),pip(0,data2),Sigma(0,data2); var : cond6(false,data2),V1(0,data2),V2(0,data2),V3(0,data2); var : Cond1(false,data2),cond2(false,data2),cond3(false,data2),cond4(false,data2); Pip = PriceScale; va1 = int(date/100)-int(date/10000)*100; //월 va2 = date - int(date/100)*100; //일 va3 = DayOfWeek(date); Cond6 = va1%3 == 0 and va2 >= 14 and va2 <= 21 and ( va3 == 1 ); //만기일 Sigma = data2((C-ma(C,sm))/STD(C,sm)); slowK = data2(stochasticsK(P1,P2)); //stochastics slow%K slowD = data2(stochasticsD(P1,P2,P3)); //stochastics slow%D CroUp = data2(CrossUp(slowK,slowD)); //stochastics 골든크로스 CroDn = data2(CrossDown(slowK,slowD)); //stochastics 데드크로스 Con1 = data2(MRO(CroUp,100,1)); //가장 최근 stochastics 골든크로스 시점의 현재로부터의 index Con2 = data2(MRO(CroUp,100,2)); //두번째로 최근 stochastics 골든크로스 시점의 현재로부터의 index V1 = data2( ma(c,mm1)); V2 = data2(ma(c,mm2)); V3 = data2(ma(c,mm3)); var5 = capital/2010; Var6 = (capital+(NetProfit*100000))/5000; //수수료 총0.7 %적용 //구분 0일경우 누적풀매매 1일경우 수량고정 if 구분==0 then { if var6 >= 1 then var7 = var6; Else var7 = 1; } if 구분 > 0 then { var7 = 구분; } #정배열이면 true 아니면 false Cond1 = V1 > V2 and V2 > V3; #역배열이면 true 아니면 false Cond2 = V1 < V2 and V2 < V3; # 3개의 이평이 모두 상승 중이면 true 아니면 false Cond3 = V1 > V1[1] and V2 > V2[1] and V3 > V3[1]; # 3개의 이평이 모두 하락 중이면 true 아니면 false Cond4 = V1 < V1[1] and V2 < V2[1] and V3 < V3[1]; //진입조건 if MarketPosition() == 0 and stime > 020000 and stime < 140000 and (Cond6==false ) then { if data2(Sigma >= 0 and countif(Cond2==true and Cond4 == true,3) < 3 and CroUp == true and slowK[Con1] > slowK[Con2] and slowK < k1) then Buy("매수",onclose,def,var7); if data2(Sigma <= 0 and countif(Cond1==true and Cond3 == true,3) < 3 And CroDn == true and slowK[Con1] < slowK[Con2] and slowK > k2) then sell("매도",onclose,def,var7); } //#만기일 청산 if Cond6==true Then { //3,6,9,12월이고 8일 ~ 14일 사이에 금요일 if MarketPosition == 1 and stime >= 000001 Then{ ExitLong("만기일B",AtMarket); } if MarketPosition == -1 and stime >= 000001 Then{ ExitShort("만기일S",AtMarket); } } //진입2 if stime > 020000 and stime < 140000 and (Cond6==false) then { if data2(crossup(c,lowest(L,ss)*(1+pb/100))) and MarketPosition() == 0 then buy("매수진입2"); if data2(CrossDown(c, highest(H,ss)*(1-ps/100))) and MarketPosition() == 0 then sell("매도진입2"); } // 일정수익후청산 if MarketPosition == 1 and highest(H,BarsSinceEntry) >= EntryPrice+Hw*Pip Then { ExitLong("매수추적스탑",AtMarket); } if MarketPosition == -1 and Lowest(L,BarsSinceEntry) <= EntryPrice-Hw*Pip then { ExitShort("매도추적스탑",AtMarket); } SetStopLoss(LL*Pip, PointStop); //손절매 즐거운 하루되세요 > 영산강 님이 쓴 글입니다. > 제목 : 수정 부탁드립니다. > 주챠트는5분봉이고 30분봉을 참조해서 진입하고 청산은 주챠트5분봉에서 할려구 하는데 잘안돼네요. 자료첨부하오니 수식수정 부탁합니다.