커뮤니티

부탁드립니다

프로필 이미지
커피한잔
2020-06-23 02:55:37
1577
글번호 140049
답변완료
더운날씨에 수고많습니다 1분차트에서 5분15분30분 그리구 일봉의 20 이동평균선을 어떻게 구현하는지 수식 부탁합니다 감사합니다
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2020-06-23 14:15:09

안녕하세요 예스스탁입니다. input : ntime1(5),ntime2(15),ntime3(30),P(20); var : S1(0),D1(0),TM(0),TF1(0),TF2(0),TF3(0),cnt(0); var : sum1(0),mav1(0); var : sum2(0),mav2(0); var : sum3(0),mav3(0); var : sum4(0),mav4(0); Array : C1[100](0),C2[100](0),C3[100](0); if Bdate != Bdate[1] Then { S1 = TimeToMinutes(stime); D1 = sdate; } if D1 > 0 then { if sdate == D1 Then TM = TimeToMinutes(stime)-S1; Else TM = TimeToMinutes(stime)+1440-S1; TF1 = TM%ntime1; TF2 = TM%ntime2; TF3 = TM%ntime3; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime1 > 1 and TF1 < TF1[1]) or (Bdate == Bdate[1] and ntime1 > 1 and TM >= TM[1]+ntime1) or (Bdate == Bdate[1] and ntime1 == 1 and TM > TM[1]) Then { for cnt = 1 to 99 { C1[cnt] = C1[cnt-1][1]; } } C1[0] = C; if C1[P-1] > 0 then { sum1 = 0; for cnt = 0 to P-1 { sum1 = sum1+C1[cnt]; } mav1 = sum1/P; plot1(mav1,"ntime1이평"); } if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime2 > 1 and TF2 < TF2[1]) or (Bdate == Bdate[1] and ntime2 > 1 and TM >= TM[1]+ntime2) or (Bdate == Bdate[1] and ntime2 == 1 and TM > TM[1]) Then { for cnt = 1 to 99 { C2[cnt] = C2[cnt-1][1]; } } C2[0] = C; if C2[P-1] > 0 then { sum2 = 0; for cnt = 0 to P-1 { sum2 = sum2+C2[cnt]; } mav2 = sum2/P; plot2(mav2,"ntime2이평"); } if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime3 > 1 and TF3 < TF3[1]) or (Bdate == Bdate[1] and ntime3 > 1 and TM >= TM[1]+ntime3) or (Bdate == Bdate[1] and ntime3 == 1 and TM > TM[1]) Then { for cnt = 1 to 99 { C3[cnt] = C3[cnt-1][1]; } } C3[0] = C; if C3[P-1] > 0 then { sum3 = 0; for cnt = 0 to P-1 { sum3 = sum3+C3[cnt]; } mav3 = sum3/P; plot3(mav3,"ntime3이평"); } } if DayClose(P-1) > 0 then { sum4 = 0; for cnt = 0 to P-1 { sum4 = sum4+DayClose(cnt); } mav4 = sum4/P; plot4(mav4,"일봉이평"); } 즐거운 하루되세요 > 커피한잔 님이 쓴 글입니다. > 제목 : 부탁드립니다 > 더운날씨에 수고많습니다 1분차트에서 5분15분30분 그리구 일봉의 20 이동평균선을 어떻게 구현하는지 수식 부탁합니다 감사합니다