커뮤니티

오류수정과 검증거처 신호와성하

프로필 이미지
회원
2013-05-10 10:15:17
213
글번호 63034
답변완료
안녕하세요 수고 하십니다 관리자님 하루에 한번 만 매매되도록 짜주시기바랍니다 2분 또는 5분 매매예정입니다 꼭 검증해보시고 신호나오는지 봐주세요 ^^ ### 1번 식 [매수] Var: Formula0(0), Formula1(0), Formula2(0), Formula3(0); Formula0 = (stime >= 090500 && stime < 150300) && (c < csar(0.02,0.2) && ma(c,10)>ma(c,26) && c>c[2] && c>(ma(C,accumN(iff(stime==090000,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+1)+(dayindex()+1)+1)) || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,20)&&ma(C,20)>ma(C,60) && (C-ma(C,5)) / STD(5)>=5 || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,26)&&ma(C,26)>ma(C,52) && crossup(macd(12,26), ema(macd(12,26),60))); if Formula0 then buy(); //[청산1] Var: Formula0(0), Formula1(0), Formula2(0), Formula3(0); Formula1 = VR(12) < 100 && VR(12)[1] >= 300 || (C-ma(C,5)) / STD(5)<=3 ; if Formula1 then exitlong(); //[청산2] Var: Formula0(0), Formula1(0), Formula2(0), Formula3(0); Formula1 = c > csar(0.02,0.2) && c<c[1] || ma(C,10)<ma(C,20)&&ma(C,20)<ma(C,60)&& crossdown(macd(12,26), ema(macd(12,26),60)) && macd(12,26)< macd(12,26)[accum(1)-highest(iff(macd(12,26)[1] < ema(macd(12,26)[1],10) && macd(12,26)[2] >= ema(macd(12,26)[2],10),accum(1),0),accum(1)-60)]; if Formula1 then exitlong(); ## 2 번 식 은 ==>> 시스템식으로 변환작업까지 하셔야해요 ㅠㅠ 감사합니다 > [매수] (c>max(c(1),c(2),c(3)) && c(1) >std(c(3),c(4),c(5))) && (ma(C,10)&&ma(C,20))>ma(C,210) || ((ma(c,5)&&ma(c,10))>ma(c,110) && CCI_C(9) > -100 && CCI_N(1,9) <= -100) [청산] (c<min(c(1),c(2),c(3)) && c(1) <std(c(2),c(3),c(4))) && (ma(C,4)&&ma(C,9))<ma(C,110))),1,0),dayindex+1)<=1) || (MFI_C(7) >= 100) || if((VR_C(8) < 100 && VR_N(1,8) >=300),1,0)+ if((ma(C,5)<ma(C,10)&&ma(C,10)<ma(C,20)&&ma(C,20)<ma(C,60) && C<L(dayIndex()) && C(1)>=L(dayIndex()) ),1,0) >=1 && ma(c,10)<ma(c,110) ### 3 번 식 Var: Formula0(0), Formula1(0), Formula2(0), Formula3(0); Formula0 = (c>(ma(C,accumN(iff(stime==090500,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+5)+(dayindex()+1)+1)) || (VR(6) > 100 && VR(12)[1] <= 300)|| (MFI(8) <= 12&&ma(c,5)>ma(c,26) && ma(c,5)>ma(c,10)>ma(c,20)) ) && accumN(iff(((stime >= 090000 && stime < 150300)&& (c>(ma(C,accumN(iff(stime==090500,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+5)+(dayindex()+1)+1)) || (VR(6) > 100 && VR(12)[1] <= 290) || (MFI(8) <= 12&&ma(c,10)>ma(c,60) &&ma(c,5)>ma(c,10)>ma(c,20)) )|| (stime >= 090000 && stime < 150300&& ((c<min(c[1],c[2],c[3])&& c[1] <std(c[3]) && c[1] <std(c[4]) && c[1] < std(c[5]))&& ma(C,4)&&ma(C,9))<ma(C,26))),1,0),dayindex()+1)<=1; Formula1 = (MFI(8) >= 100) || iff((VR(8) < 100 && VR(12)[1] >=300),1,0)+ iff((ma(C,3)<ma(C,10)&&ma(C,5)<ma(C,10)&&ma(C,10)<ma(C,50)&& C<L[dayIndex()] && C[1]>=L[dayIndex()] ),1,0)>=1&& ma(c,10)<ma(c,52); if Formula0 Then Buy(); if Formula1 Then Exitlong(); ====================================================================== 사용자함수 VR Input : Period(Numeric); Var : value1(0), value2(0), value3(0); value1 = iff(C>C[1],V,0); value2 = iff(C<C[1],V,0); value3 = iff(C==C[1],V,0); VR = (accumN(value1,Period)+accumN(value3,Period)/2)/ (accumN(value2,Period)+accumN(value3,Period)/2) *100; ----------------------------------------------------------------------- MFI Input : Period(Numeric); Var : value1(0), value2(0), value3(0); value1 = H+L+C; value2 = iff(value1>value1[1], V*value1/3,0); value3 = iff(value1<value1[1], V*value1/3,0); MFI = 100-100/(1+(accumN(value2,Period)/accumN(value3,Period))); ### 4번 식 Var: Formula0(0), Formula1(0), Formula2(0), Formula3(0); Formula0 = (stime >= 090500 && stime < 150300) && (c < csar(0.02,0.2) && ma(c,10)>ma(c,26) && c>c[2] && c>(ma(C,accumN(iff(stime==090000,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+1)+(dayindex()+1)+1)) || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,20)&&ma(C,20)>ma(C,60) && (C-ma(C,5)) / STD(5)>=5 || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,26)&&ma(C,26)>ma(C,52) && crossup(macd(12,26), ema(macd(12,26),60))); Formula1 = VR(12) < 100 && VR(12)[1] >= 300 || (C-ma(C,5)) / STD(5)<=3 ; if Formula0 then buy(); if Formula1 then exitlong(); ### 5 번식 Var: Formula0(0), Formula1(0), Formula2(0), Formula3(0); Formula0 = (stime >= 090500 && stime < 150300) && (c < csar(0.02,0.2) && ma(c,10)>ma(c,26) && c>c[2] && c>(ma(C,accumN(iff(stime==090000,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+1)+(dayindex()+1)+1)) || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,20)&&ma(C,20)>ma(C,60) && (C-ma(C,5)) / STD(5)>=5 || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,26)&&ma(C,26)>ma(C,52) && crossup(macd(12,26), ema(macd(12,26),60))); Formula1 = c > csar(0.02,0.2) && c<c[1] || ma(C,10)<ma(C,20)&&ma(C,20)<ma(C,60)&& crossdown(macd(12,26), ema(macd(12,26),60)) && macd(12,26)< macd(12,26)[accum(1)-highest(iff(macd(12,26)[1] < ema(macd(12,26)[1],10) && macd(12,26)[2] >= ema(macd(12,26)[2],10),accum(1),0),accum(1)-60)]; if Formula0 then buy(); if Formula1 then exitlong(); ### 6 번식 var : macdD(0), macdS(0),value(0); macdD = macd(12,26); macdS = ema(macdD,12); var1 = (C-entryprice(0))/entryprice(0)*100; // 기본차트 상승률 var2 = (data1("C")-value)/value*100; //보조차트 상승률 if macdD > macdS && macdD[1] <= macdS[1] then{ buy(); value = data1("C"); } if macdD < macdS && macdD[1] >= macdS[1] then exitlong(); if (var1+var2)/2 > 20 then exitlong("청산1"); // 합성목표수익율 평균이 20% 초과시 청산 // 검증 필요 에러 조금 있으니 양해바라옵고요 // 수정과 검증 부탁 드려요 신호나오면 별다섯게 드려요^^ 감사합니다
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2013-05-10 13:42:38

안녕하세요 예스스탁입니다. 전반적으로 사용된 식에 STD가 어떤것을 의미하는 함수인지 모르겠습니다. 어떤식에서는 std(5)라고만 되어 있고 어떤식에서는 std(c(3),c(4),c(5)))라고 되어 있어 어떻게 변환을 해드려야 할지 모르겠습니다. std(5)는 std(c,5)로 변경해 올려드립니다. 2번식은 변환하지 못했습니다. 1. var : cnt(0),count(0); count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } if MarketPosition == 0 and count == 0 Then{ if (stime >= 090500 && stime < 150300) && (c < csar(0.02,0.2) && ma(c,10)>ma(c,26) && c>c[2] && c>(ma(C,accumN(iff(stime==090000,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+1)+(dayindex()+1)+1)) || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,20)&&ma(C,20)>ma(C,60) && (C-ma(C,5)) / STD(c,5)>=5 || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,26)&&ma(C,26)>ma(C,52) && crossup(macd(12,26), ema(macd(12,26),60))) then buy(); } if MarketPosition == 1 then{ if VR(12) < 100 && VR(12)[1] >= 300 || (C-ma(C,5)) / STD(c,5)<=3 then exitlong(); if c > csar(0.02,0.2) && c<c[1] || ma(C,10)<ma(C,20)&&ma(C,20)<ma(C,60)&& crossdown(macd(12,26), ema(macd(12,26),60)) && macd(12,26)< macd(12,26)[accum(1)-highest(iff(macd(12,26)[1] < ema(macd(12,26)[1],10) && macd(12,26)[2] >= ema(macd(12,26)[2],10),accum(1),0),accum(1)-60)] Then exitlong(); } 3. Var: Formula0(false), Formula1(false), Formula2(0), Formula3(0); var : cnt(0),count(0); count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } Formula0 = (c>(ma(C,accumN(iff(stime==090500,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+5)+(dayindex()+1)+1)) || (VR(6) > 100 && VR(12)[1] <= 300)|| (MFI(8) <= 12&&ma(c,5)>ma(c,26) && ma(c,5)>ma(c,10)and ma(c,10)>ma(c,20)) ) && accumN(iff(((stime >= 090000 && stime < 150300)&& (c>(ma(C,accumN(iff(stime==090500,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+5)+(dayindex()+1)+1)) || (VR(6) > 100 && VR(12)[1] <= 290) || (MFI(8) <= 12&&ma(c,10)>ma(c,60) &&ma(c,5)>ma(c,10)and ma(c,10)>ma(c,20)) )|| (stime >= 090000 && stime < 150300&& ((c<min(c[1],c[2],c[3])&& c[1] < c[3] && c[1] < c[4] && c[1] < c[5])&& ma(C,4)&&ma(C,9))and ma(c,9)<ma(C,26))),1,0),dayindex()+1)<=1; Formula1 = (MFI(8) >= 100) || iff((VR(8) < 100 && VR(12)[1] >=300),1,0)+ iff((ma(C,3)<ma(C,10)&&ma(C,5)<ma(C,10)&&ma(C,10)<ma(C,50)&& C<L[dayIndex()] && C[1]>=L[dayIndex()] ),1,0)>=1&& ma(c,10)<ma(c,52); if MarketPosition == 0 and count == 0 and Formula0 Then Buy(); if MarketPosition == 1 and Formula1 Then Exitlong(); 4. Var: Formula0(false), Formula1(false), Formula2(0), Formula3(0); var : cnt(0),count(0); count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } Formula0 = (stime >= 090500 && stime < 150300) && (c < csar(0.02,0.2) && ma(c,10)>ma(c,26) && c>c[2] && c>(ma(C,accumN(iff(stime==090000,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+1)+(dayindex()+1)+1)) || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,20)&&ma(C,20)>ma(C,60) && (C-ma(C,5)) / STD(c,5)>=5 || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,26)&&ma(C,26)>ma(C,52) && crossup(macd(12,26), ema(macd(12,26),60))); Formula1 = VR(12) < 100 && VR(12)[1] >= 300 || (C-ma(C,5)) / STD(c,5)<=3 ; if MarketPosition == 0 and count == 0 Then{ if Formula0 then buy(); } if MarketPosition == 1 and Formula1 then exitlong(); 5. Var: Formula0(false), Formula1(false); var : cnt(0),count(0); count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } Formula0 = (stime >= 090500 && stime < 150300) && (c < csar(0.02,0.2) && ma(c,10)>ma(c,26) && c>c[2] && c>(ma(C,accumN(iff(stime==090000,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+1)+(dayindex()+1)+1)) || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,20)&&ma(C,20)>ma(C,60) && (C-ma(C,5)) / STD(c,5)>=5 || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,26)&&ma(C,26)>ma(C,52) && crossup(macd(12,26), ema(macd(12,26),60))); Formula1 = c > csar(0.02,0.2) && c<c[1] || ma(C,10)<ma(C,20)&&ma(C,20)<ma(C,60)&& crossdown(macd(12,26), ema(macd(12,26),60)) && macd(12,26)< macd(12,26)[accum(1)-highest(iff(macd(12,26)[1] < ema(macd(12,26)[1],10) && macd(12,26)[2] >= ema(macd(12,26)[2],10),accum(1),0),accum(1)-60)]; if MarketPosition == 0 and count == 0 Then{ if Formula0 then buy(); } if Formula1 then exitlong(); 6 var : macdD(0), macdS(0),value(0); var : cnt(0),count(0); count = 0; for cnt = 0 to 20{ if sdate == EntryDate(cnt) Then count = count+1; } macdD = macd(12,26); macdS = ema(macdD,12); var1 = (C-entryprice(0))/entryprice(0)*100; // 기본차트 상승률 var2 = (data2(C)-value)/value*100; //보조차트 상승률 if MarketPosition == 0 and count == 0 then{ if macdD > macdS && macdD[1] <= macdS[1] then{ buy(); value = data2(C); } } if macdD < macdS && macdD[1] >= macdS[1] then exitlong(); if (var1+var2)/2 > 20 then exitlong("청산1"); // 합성목표수익율 평균이 20% 초과시 청산 즐거운 하루되세요 > yang오뚜기 님이 쓴 글입니다. > 제목 : 오류수정과 검증거처 신호와성하 > 안녕하세요 수고 하십니다 관리자님 하루에 한번 만 매매되도록 짜주시기바랍니다 2분 또는 5분 매매예정입니다 꼭 검증해보시고 신호나오는지 봐주세요 ^^ ### 1번 식 [매수] Var: Formula0(0), Formula1(0), Formula2(0), Formula3(0); Formula0 = (stime >= 090500 && stime < 150300) && (c < csar(0.02,0.2) && ma(c,10)>ma(c,26) && c>c[2] && c>(ma(C,accumN(iff(stime==090000,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+1)+(dayindex()+1)+1)) || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,20)&&ma(C,20)>ma(C,60) && (C-ma(C,5)) / STD(5)>=5 || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,26)&&ma(C,26)>ma(C,52) && crossup(macd(12,26), ema(macd(12,26),60))); if Formula0 then buy(); //[청산1] Var: Formula0(0), Formula1(0), Formula2(0), Formula3(0); Formula1 = VR(12) < 100 && VR(12)[1] >= 300 || (C-ma(C,5)) / STD(5)<=3 ; if Formula1 then exitlong(); //[청산2] Var: Formula0(0), Formula1(0), Formula2(0), Formula3(0); Formula1 = c > csar(0.02,0.2) && c<c[1] || ma(C,10)<ma(C,20)&&ma(C,20)<ma(C,60)&& crossdown(macd(12,26), ema(macd(12,26),60)) && macd(12,26)< macd(12,26)[accum(1)-highest(iff(macd(12,26)[1] < ema(macd(12,26)[1],10) && macd(12,26)[2] >= ema(macd(12,26)[2],10),accum(1),0),accum(1)-60)]; if Formula1 then exitlong(); ## 2 번 식 은 ==>> 시스템식으로 변환작업까지 하셔야해요 ㅠㅠ 감사합니다 > [매수] (c>max(c(1),c(2),c(3)) && c(1) >std(c(3),c(4),c(5))) && (ma(C,10)&&ma(C,20))>ma(C,210) || ((ma(c,5)&&ma(c,10))>ma(c,110) && CCI_C(9) > -100 && CCI_N(1,9) <= -100) [청산] (c<min(c(1),c(2),c(3)) && c(1) <std(c(2),c(3),c(4))) && (ma(C,4)&&ma(C,9))<ma(C,110))),1,0),dayindex+1)<=1) || (MFI_C(7) >= 100) || if((VR_C(8) < 100 && VR_N(1,8) >=300),1,0)+ if((ma(C,5)<ma(C,10)&&ma(C,10)<ma(C,20)&&ma(C,20)<ma(C,60) && C<L(dayIndex()) && C(1)>=L(dayIndex()) ),1,0) >=1 && ma(c,10)<ma(c,110) ### 3 번 식 Var: Formula0(0), Formula1(0), Formula2(0), Formula3(0); Formula0 = (c>(ma(C,accumN(iff(stime==090500,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+5)+(dayindex()+1)+1)) || (VR(6) > 100 && VR(12)[1] <= 300)|| (MFI(8) <= 12&&ma(c,5)>ma(c,26) && ma(c,5)>ma(c,10)>ma(c,20)) ) && accumN(iff(((stime >= 090000 && stime < 150300)&& (c>(ma(C,accumN(iff(stime==090500,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+5)+(dayindex()+1)+1)) || (VR(6) > 100 && VR(12)[1] <= 290) || (MFI(8) <= 12&&ma(c,10)>ma(c,60) &&ma(c,5)>ma(c,10)>ma(c,20)) )|| (stime >= 090000 && stime < 150300&& ((c<min(c[1],c[2],c[3])&& c[1] <std(c[3]) && c[1] <std(c[4]) && c[1] < std(c[5]))&& ma(C,4)&&ma(C,9))<ma(C,26))),1,0),dayindex()+1)<=1; Formula1 = (MFI(8) >= 100) || iff((VR(8) < 100 && VR(12)[1] >=300),1,0)+ iff((ma(C,3)<ma(C,10)&&ma(C,5)<ma(C,10)&&ma(C,10)<ma(C,50)&& C<L[dayIndex()] && C[1]>=L[dayIndex()] ),1,0)>=1&& ma(c,10)<ma(c,52); if Formula0 Then Buy(); if Formula1 Then Exitlong(); ====================================================================== 사용자함수 VR Input : Period(Numeric); Var : value1(0), value2(0), value3(0); value1 = iff(C>C[1],V,0); value2 = iff(C<C[1],V,0); value3 = iff(C==C[1],V,0); VR = (accumN(value1,Period)+accumN(value3,Period)/2)/ (accumN(value2,Period)+accumN(value3,Period)/2) *100; ----------------------------------------------------------------------- MFI Input : Period(Numeric); Var : value1(0), value2(0), value3(0); value1 = H+L+C; value2 = iff(value1>value1[1], V*value1/3,0); value3 = iff(value1<value1[1], V*value1/3,0); MFI = 100-100/(1+(accumN(value2,Period)/accumN(value3,Period))); ### 4번 식 Var: Formula0(0), Formula1(0), Formula2(0), Formula3(0); Formula0 = (stime >= 090500 && stime < 150300) && (c < csar(0.02,0.2) && ma(c,10)>ma(c,26) && c>c[2] && c>(ma(C,accumN(iff(stime==090000,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+1)+(dayindex()+1)+1)) || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,20)&&ma(C,20)>ma(C,60) && (C-ma(C,5)) / STD(5)>=5 || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,26)&&ma(C,26)>ma(C,52) && crossup(macd(12,26), ema(macd(12,26),60))); Formula1 = VR(12) < 100 && VR(12)[1] >= 300 || (C-ma(C,5)) / STD(5)<=3 ; if Formula0 then buy(); if Formula1 then exitlong(); ### 5 번식 Var: Formula0(0), Formula1(0), Formula2(0), Formula3(0); Formula0 = (stime >= 090500 && stime < 150300) && (c < csar(0.02,0.2) && ma(c,10)>ma(c,26) && c>c[2] && c>(ma(C,accumN(iff(stime==090000,dayindex()-highest(iff(dayHigh()==H,dayindex(),0),dayindex()+1),0),dayindex()+1)+(dayindex()+1)+1)) || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,20)&&ma(C,20)>ma(C,60) && (C-ma(C,5)) / STD(5)>=5 || ma(C,5)>ma(C,10)&&ma(C,10)>ma(C,26)&&ma(C,26)>ma(C,52) && crossup(macd(12,26), ema(macd(12,26),60))); Formula1 = c > csar(0.02,0.2) && c<c[1] || ma(C,10)<ma(C,20)&&ma(C,20)<ma(C,60)&& crossdown(macd(12,26), ema(macd(12,26),60)) && macd(12,26)< macd(12,26)[accum(1)-highest(iff(macd(12,26)[1] < ema(macd(12,26)[1],10) && macd(12,26)[2] >= ema(macd(12,26)[2],10),accum(1),0),accum(1)-60)]; if Formula0 then buy(); if Formula1 then exitlong(); ### 6 번식 var : macdD(0), macdS(0),value(0); macdD = macd(12,26); macdS = ema(macdD,12); var1 = (C-entryprice(0))/entryprice(0)*100; // 기본차트 상승률 var2 = (data1("C")-value)/value*100; //보조차트 상승률 if macdD > macdS && macdD[1] <= macdS[1] then{ buy(); value = data1("C"); } if macdD < macdS && macdD[1] >= macdS[1] then exitlong(); if (var1+var2)/2 > 20 then exitlong("청산1"); // 합성목표수익율 평균이 20% 초과시 청산 // 검증 필요 에러 조금 있으니 양해바라옵고요 // 수정과 검증 부탁 드려요 신호나오면 별다섯게 드려요^^ 감사합니다