커뮤니티

시스템식 하나

프로필 이미지
에구머니
2010-08-24 23:26:31
875
글번호 31822
답변완료
시스템식 부탁드립니다. 감사합니다.
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2010-08-25 11:09:19

안녕하세요 예스스탁입니다. input : P1(5),P2(20),P3(60); input : Period(12), Period1(5), Period2(5); var : highVal(0), lowVal(0), FstK(0), SlwK(0), SlwD(0); var : Ep1(0), Ep2(0), PreSlowK(0), PreSlowD(0); var : sumV1(0),maV1(0),count(0),sumV2(0), maV2(0),sumV3(0), maV3(0),ecnt(0),ecount(0); sumV1 = 0; sumV2 = 0; sumV3 = 0; for count = 0 to P3{ if count < P1 Then sumV1 = sumV1+DayClose(count); if count < P2 Then sumV2 = sumV2+DayClose(count); if count < P3 Then sumV3 = sumV3+DayClose(count); } maV1 = sumV1 / P1; maV2 = sumV2 / P2; maV3 = sumV3 / P3; #특정 구간의 고가 및 저가 highVal = dayhigh(0); lowVal = daylow(0); for count = 0 to Period-1 { if dayHigh(count) > highVal then highVal = dayhigh(count); if dayLow(count) < lowVal then lowVal = dayLow(count); } #Fast StochasticsK fstK = (C-lowVal)/(highVal-lowVal)*100; #Slow StochasticsK / Slow StochasticsD Ep1 = 2/(Period1+1); Ep2 = 2/(Period2+1); if date != date[1] then { PreSlowK = SlwK[1]; PreSlowD = SlwD[1]; } SlwK = fstK * EP1 + PreslowK * (1-EP1); SlwD = slwK * EP2 + PreslowD * (1-EP2); ecount = 0; for ecnt = 0 to 10{ if sdate == EntryDate(ecnt) Then ecount = ecount+1; } Condition1 = L[2] > L[1] and L[1] < L and L[1] < ma(c,20)[1]; Condition2 = H[2] < H[1] and H[1] > H and H[1] < ma(C,20)[1]; if Condition1 == true Then{ var1 = highest(H,3); var2 = L[2]; } if Condition2 == true Then{ var3 = Lowest(L,3); var4 = H[2]; } if ecount == 0 and MarketPosition == 0 Then{ if countif(Condition1 == true,5) >= 1 And CrossUp(c,var1) And mav1 > mav2 and mav2 > mav3 and slwk > slwd and stime >= 93000 and stime < 142000 Then buy(); if countif(Condition2 == true,5) >= 1 And CrossDown(c,var2) And mav1 < mav2 and mav2 < mav3 and slwk < slwd and stime >= 93000 and stime < 142000 Then buy(); } if ecount > 0 and count < 2 and MarketPosition == 0 and TimeToMinutes(stime) >= TimeToMinutes(ExitPrice(1))+30 Then{ if countif(Condition1 == true,5) >= 1 And CrossUp(c,var1) And mav1 > mav2 and mav2 > mav3 and slwk > slwd and stime >= 93000 and stime < 142000 Then buy(); if countif(Condition2 == true,5) >= 1 And CrossDown(c,var2) And mav1 < mav2 and mav2 < mav3 and slwk < slwd and stime >= 93000 and stime < 142000 Then sell(); } if MarketPosition == 1 Then ExitLong("bx",AtStop,var2[BarsSinceEntry]); if MarketPosition == -1 Then ExitShort("sx",AtStop,var4[BarsSinceEntry]); 즐거운 하루되세요 > 에구머니 님이 쓴 글입니다. > 제목 : 시스템식 하나 > 시스템식 부탁드립니다. 감사합니다.
프로필 이미지

에구머니

2010-08-25 15:21:55

이렇게 복잡한 식을 이렇게 빨리 작성해 주시다니 정말 고맙습니다. 시간 나실 때, 맛있는 안주에, 소주 한잔 꼭 사드리고 싶습니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 시스템식 하나 > 안녕하세요 예스스탁입니다. input : P1(5),P2(20),P3(60); input : Period(12), Period1(5), Period2(5); var : highVal(0), lowVal(0), FstK(0), SlwK(0), SlwD(0); var : Ep1(0), Ep2(0), PreSlowK(0), PreSlowD(0); var : sumV1(0),maV1(0),count(0),sumV2(0), maV2(0),sumV3(0), maV3(0),ecnt(0),ecount(0); sumV1 = 0; sumV2 = 0; sumV3 = 0; for count = 0 to P3{ if count < P1 Then sumV1 = sumV1+DayClose(count); if count < P2 Then sumV2 = sumV2+DayClose(count); if count < P3 Then sumV3 = sumV3+DayClose(count); } maV1 = sumV1 / P1; maV2 = sumV2 / P2; maV3 = sumV3 / P3; #특정 구간의 고가 및 저가 highVal = dayhigh(0); lowVal = daylow(0); for count = 0 to Period-1 { if dayHigh(count) > highVal then highVal = dayhigh(count); if dayLow(count) < lowVal then lowVal = dayLow(count); } #Fast StochasticsK fstK = (C-lowVal)/(highVal-lowVal)*100; #Slow StochasticsK / Slow StochasticsD Ep1 = 2/(Period1+1); Ep2 = 2/(Period2+1); if date != date[1] then { PreSlowK = SlwK[1]; PreSlowD = SlwD[1]; } SlwK = fstK * EP1 + PreslowK * (1-EP1); SlwD = slwK * EP2 + PreslowD * (1-EP2); ecount = 0; for ecnt = 0 to 10{ if sdate == EntryDate(ecnt) Then ecount = ecount+1; } Condition1 = L[2] > L[1] and L[1] < L and L[1] < ma(c,20)[1]; Condition2 = H[2] < H[1] and H[1] > H and H[1] < ma(C,20)[1]; if Condition1 == true Then{ var1 = highest(H,3); var2 = L[2]; } if Condition2 == true Then{ var3 = Lowest(L,3); var4 = H[2]; } if ecount == 0 and MarketPosition == 0 Then{ if countif(Condition1 == true,5) >= 1 And CrossUp(c,var1) And mav1 > mav2 and mav2 > mav3 and slwk > slwd and stime >= 93000 and stime < 142000 Then buy(); if countif(Condition2 == true,5) >= 1 And CrossDown(c,var2) And mav1 < mav2 and mav2 < mav3 and slwk < slwd and stime >= 93000 and stime < 142000 Then buy(); } if ecount > 0 and count < 2 and MarketPosition == 0 and TimeToMinutes(stime) >= TimeToMinutes(ExitPrice(1))+30 Then{ if countif(Condition1 == true,5) >= 1 And CrossUp(c,var1) And mav1 > mav2 and mav2 > mav3 and slwk > slwd and stime >= 93000 and stime < 142000 Then buy(); if countif(Condition2 == true,5) >= 1 And CrossDown(c,var2) And mav1 < mav2 and mav2 < mav3 and slwk < slwd and stime >= 93000 and stime < 142000 Then sell(); } if MarketPosition == 1 Then ExitLong("bx",AtStop,var2[BarsSinceEntry]); if MarketPosition == -1 Then ExitShort("sx",AtStop,var4[BarsSinceEntry]); 즐거운 하루되세요 > 에구머니 님이 쓴 글입니다. > 제목 : 시스템식 하나 > 시스템식 부탁드립니다. 감사합니다.