커뮤니티

수식문의

프로필 이미지
회원
2005-02-27 22:53:48
1559
글번호 6669
답변완료
안녕하세요 전에 담당자님께서 주셨던 수식인데,약간 변형 부탁드립니다. 예제] 매수조건= 5/20 골드크로스 이후 발생한 봉두개중 -0.25 이상되는 음봉이 없어야 한다. 3번째봉 시가가 5이평 위에있어야한다 , 만족하면 3번째봉에 매수. 아래 식을 참고로 매도조건식도 부탁합니다. 즐거운하루 되세요. [시스템식] var : bidx(0), bcond1(0), bval1(0), bcond2(0), bpos(0); if CrossUp(ma(C,5), ma(C,20)) then { bidx = accum(1); bcond1 = 1; bval1 = H; } if bcond1 == 1 and accum(1)-bidx == 2 then { var1 = (C+C[1])/2; if var1 > bval1-0.25 then { bcond2 = 1; if bcond2 == 1 and accumN(C < O, 2) != 2 and C > O then { buy(); bpos = 1; } } else { bcond1 = 0; bcond2 = 0; } } if bpos != 1 and bcond2 == 1 and accum(1)-bidx == 3 and C > O then { buy(); bpos = 1; } if Crossdown(ma(C,5), ma(C,20)) then { exitlong(); bpos = 0; bcond1 = 0; bcond2 = 0; }
시스템
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2005-03-02 09:36:26

안녕하세요 예스스탁입니다. 문의하신 식은 다음과 같습니다. 문의하신 부분을 추가하고, 매도식은 반대로 했습니다. var : bidx(0), bcond1(0), bval1(0), bcond2(0), bpos(0), Sidx(0), Scond1(0), Sval1(0), Scond2(0), Spos(0); if CrossUp(ma(C,5), ma(C,20)) then { bidx = index(); bcond1 = 1; bval1 = H; } if bcond1 == 1 and index()-bidx == 2 then { var1 = (C+C[1])/2; if var1 > bval1-0.25 then { bcond2 = 1; if bcond2 == 1 and accumN(C < O, 2) != 2 and C > O then { buy("매수1"); bpos = 1; } } else { bcond1 = 0; bcond2 = 0; } } if bpos != 1 and bcond2 == 1 and index()-bidx == 3 and C > O and accumn(iff(C[1] < O[1]-0.25,1,0),2) < 1 and //-0.25이상되는 음봉이 없어야 한다 O > ma(c,5) then { //시가는 5이평위에 있어야 한다 buy("매수2"); bpos = 1; } if Crossdown(ma(C,5), ma(C,20)) then { exitlong("매수청산"); bpos = 0; bcond1 = 0; bcond2 = 0; } /////////////////////////////////////////////////////// if Crossdown(ma(C,5), ma(C,20)) then { Sidx = index(); Scond1 = 1; Sval1 = L; } if Scond1 == 1 and index()-bidx == 2 then { var1 = (C+C[1])/2; if var1 < Sval1+0.25 then { Scond2 = 1; if Scond2 == 1 and accumN(C > O, 2) != 2 and C < O then { sell("매도1"); Spos = 1; } } else { Scond1 = 0; Scond2 = 0; } } if Spos != 1 and Scond2 == 1 and index()-Sidx == 3 and C < O and accumn(iff(C[1] > O[1]+0.25,1,0),2) < 1 and //+0.25이상되는 양봉이 없어야 한다 O < ma(c,5) then { //시가는 5이평 아래에 있어야 한다 sell("매도2"); Spos = 1; } if Crossup(ma(C,5), ma(C,20)) then { exitshort("매도청산"); Spos = 0; Scond1 = 0; Scond2 = 0; } 즐거운 하루되세요 > 시라즈 님이 쓴 글입니다. > 제목 : 수식문의 > 안녕하세요 전에 담당자님께서 주셨던 수식인데,약간 변형 부탁드립니다. 예제] 매수조건= 5/20 골드크로스 이후 발생한 봉두개중 -0.25 이상되는 음봉이 없어야 한다. 3번째봉 시가가 5이평 위에있어야한다 , 만족하면 3번째봉에 매수. 아래 식을 참고로 매도조건식도 부탁합니다. 즐거운하루 되세요. [시스템식] var : bidx(0), bcond1(0), bval1(0), bcond2(0), bpos(0); if CrossUp(ma(C,5), ma(C,20)) then { bidx = accum(1); bcond1 = 1; bval1 = H; } if bcond1 == 1 and accum(1)-bidx == 2 then { var1 = (C+C[1])/2; if var1 > bval1-0.25 then { bcond2 = 1; if bcond2 == 1 and accumN(C < O, 2) != 2 and C > O then { buy(); bpos = 1; } } else { bcond1 = 0; bcond2 = 0; } } if bpos != 1 and bcond2 == 1 and accum(1)-bidx == 3 and C > O then { buy(); bpos = 1; } if Crossdown(ma(C,5), ma(C,20)) then { exitlong(); bpos = 0; bcond1 = 0; bcond2 = 0; }