커뮤니티

수식문의

프로필 이미지
밝은아침
2013-06-28 18:20:02
250
글번호 64854
답변완료
연결선물지수 기준, 주봉 Stochastics K_D 이용 일봉 Stochastics K_D 이용 주간 %K가 %D를 CrossUp해서 CrossDown하기 전까지는 - 일간 %K가 %D를 CrossUp할때마다 1계약씩 매수 - 주간 %K가 %D를 CrossDown하면 매수분 전량 청산 주간 %K가 %D를 CrossDown해서 CrossUp하기 전까지는 - 일간 %K가 %D를 CrossDown할때마다 1계약씩 매도 - 주간 %K가 %D를 CrossUp하면 매도분 전량 청산 수식 부탁드립니다. 수고하세요.
시스템
답변 2
프로필 이미지

예스스탁 예스스탁 답변

2013-07-01 10:59:29

안녕하세요 예스스탁입니다. input :StoPeriod(10), StoPeriod1(5), StoPeriod2(5); var : count(0), highVal(0), lowVal(0), StoFastK(0), StoK(0), StoD(0); var : Ep(0), EP1(0), JISU(0), DINDEX(0), PreStoK(0), PreStoD(0),cnt(0); var : Dstok(0),Dstod(0); Array : HH[50](0),LL[50](0); if DayOfWeek(sdate) < DayOfWeek(sdate[1]) Then{ HH[0] = H; LL[0] = L; for cnt = 1 to 49{ HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; } } if H > HH[0] Then HH[0] = H; if L < LL[0] Then LL[0] = L; highVal = HH[0]; lowVal = LL[0]; for count = 0 to StoPeriod-1 { if HH[count] > highVal then highVal = HH[count]; if LL[count] < lowVal then lowVal = LL[count]; } StoFastK = (C-lowVal)/(highVal-lowVal)*100; #### Slow StochasticsK #### Ep = 2/(StoPeriod1+1); if DINDEX >= StoPeriod and DayOfWeek(sdate) < DayOfWeek(sdate[1]) then { DINDEX = DINDEX + 1; PreStoK = StoK[1]; } if DINDEX <= 1 then StoK = StoFastK ; else StoK = StoFastK * EP + PreStoK * (1-EP); #### Slow StochasticsD #### Ep1 = 2/(StoPeriod2+1); if DayOfWeek(sdate) < DayOfWeek(sdate[1]) then { DINDEX = DINDEX + 1; PreStoD = StoD[1]; } if DINDEX <= 1 then StoD = StoK ; else StoD = StoK * EP1 + PreStoD * (1-EP1); dstok = StochasticsK(StoPeriod,StoPeriod1); Dstod = StochasticsD(StoPeriod,StoPeriod1,StoPeriod2); if stok > stod and crossup(Dstok,Dstod) Then buy(); if CrossDown(stok,stod) Then exitlong(); if stok < stod and CrossDown(Dstok,Dstod) Then Sell(); if CrossUp(stok,stod) Then ExitShort(); 일봉에 적용하시면 됩니다. 즐거운 하루되세요 > 밝은아침 님이 쓴 글입니다. > 제목 : 수식문의 > 연결선물지수 기준, 주봉 Stochastics K_D 이용 일봉 Stochastics K_D 이용 주간 %K가 %D를 CrossUp해서 CrossDown하기 전까지는 - 일간 %K가 %D를 CrossUp할때마다 1계약씩 매수 - 주간 %K가 %D를 CrossDown하면 매수분 전량 청산 주간 %K가 %D를 CrossDown해서 CrossUp하기 전까지는 - 일간 %K가 %D를 CrossDown할때마다 1계약씩 매도 - 주간 %K가 %D를 CrossUp하면 매도분 전량 청산 수식 부탁드립니다. 수고하세요.
프로필 이미지

밝은아침

2013-07-03 14:14:46

주봉 Stochastics K_D, 일봉 Stochastics K_D 에서 각각의 K_D 지표를 Input으로 설정할 수 있도록 했으면 합니다. 그러니까 주봉 K_D input(1,2,3) 및 일봉 K_D input(4,5,6) 등으로요. 수정 부탁 드립니다. 감사합니다. > 예스스탁 님이 쓴 글입니다. > 제목 : Re : 수식문의 > 안녕하세요 예스스탁입니다. input :StoPeriod(10), StoPeriod1(5), StoPeriod2(5); var : count(0), highVal(0), lowVal(0), StoFastK(0), StoK(0), StoD(0); var : Ep(0), EP1(0), JISU(0), DINDEX(0), PreStoK(0), PreStoD(0),cnt(0); var : Dstok(0),Dstod(0); Array : HH[50](0),LL[50](0); if DayOfWeek(sdate) < DayOfWeek(sdate[1]) Then{ HH[0] = H; LL[0] = L; for cnt = 1 to 49{ HH[cnt] = HH[cnt-1][1]; LL[cnt] = LL[cnt-1][1]; } } if H > HH[0] Then HH[0] = H; if L < LL[0] Then LL[0] = L; highVal = HH[0]; lowVal = LL[0]; for count = 0 to StoPeriod-1 { if HH[count] > highVal then highVal = HH[count]; if LL[count] < lowVal then lowVal = LL[count]; } StoFastK = (C-lowVal)/(highVal-lowVal)*100; #### Slow StochasticsK #### Ep = 2/(StoPeriod1+1); if DINDEX >= StoPeriod and DayOfWeek(sdate) < DayOfWeek(sdate[1]) then { DINDEX = DINDEX + 1; PreStoK = StoK[1]; } if DINDEX <= 1 then StoK = StoFastK ; else StoK = StoFastK * EP + PreStoK * (1-EP); #### Slow StochasticsD #### Ep1 = 2/(StoPeriod2+1); if DayOfWeek(sdate) < DayOfWeek(sdate[1]) then { DINDEX = DINDEX + 1; PreStoD = StoD[1]; } if DINDEX <= 1 then StoD = StoK ; else StoD = StoK * EP1 + PreStoD * (1-EP1); dstok = StochasticsK(StoPeriod,StoPeriod1); Dstod = StochasticsD(StoPeriod,StoPeriod1,StoPeriod2); if stok > stod and crossup(Dstok,Dstod) Then buy(); if CrossDown(stok,stod) Then exitlong(); if stok < stod and CrossDown(Dstok,Dstod) Then Sell(); if CrossUp(stok,stod) Then ExitShort(); 일봉에 적용하시면 됩니다. 즐거운 하루되세요 > 밝은아침 님이 쓴 글입니다. > 제목 : 수식문의 > 연결선물지수 기준, 주봉 Stochastics K_D 이용 일봉 Stochastics K_D 이용 주간 %K가 %D를 CrossUp해서 CrossDown하기 전까지는 - 일간 %K가 %D를 CrossUp할때마다 1계약씩 매수 - 주간 %K가 %D를 CrossDown하면 매수분 전량 청산 주간 %K가 %D를 CrossDown해서 CrossUp하기 전까지는 - 일간 %K가 %D를 CrossDown할때마다 1계약씩 매도 - 주간 %K가 %D를 CrossUp하면 매도분 전량 청산 수식 부탁드립니다. 수고하세요.