커뮤니티

적합이평부탁드립니다

프로필 이미지
커피한잔
2023-05-07 12:47:15
1181
글번호 168738
답변완료
수고하십니다 1분차트에서 5분차트에 적합이평 그리기 부탁드립니다 항상감사합니다 즐거운 주말보내십시요
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2023-05-08 10:03:47

안녕하세요 예스스탁입니다. input : ntime(5),Period(20); Vars: Noise(0), Signal(0), Diff(0), efRatio(0),Smooth(1), Fastest(0.6667), Slowest(0.0645), AdaptMA(0); var : S1(0),D1(0),TM(0),TF(0),cnt(0),sum(0),mav(0),idx(0),AdaptMA1(0); Array : C1[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; TF = TM%ntime; if Bdate != Bdate[1] or (Bdate == Bdate[1] and ntime > 1 and TF < TF[1]) or (Bdate == Bdate[1] and ntime > 1 and TM >= TM[1]+ntime) or (Bdate == Bdate[1] and ntime == 1 and TM > TM[1]) Then { idx = idx+1; for cnt = 1 to 99 { C1[cnt] = C1[cnt-1][1]; } AdaptMA1 = AdaptMA[1]; } C1[0] = C; if idx <= Period Then AdaptMA = C1[0]; Else { Signal = AbsValue(C1[0] - C1[Period]); Noise = 0; For cnt = 0 to Period-1 { Noise = Noise + abs(C1[cnt]-C1[cnt+1]); } efRatio = Signal / Noise; Smooth = Power(efRatio * (Fastest - Slowest) + Slowest, 2); AdaptMA = AdaptMA1 + Smooth * (c - AdaptMA1); } Plot1(Adaptma); } 즐거운 하루되세요 > 커피한잔 님이 쓴 글입니다. > 제목 : 적합이평부탁드립니다 > 수고하십니다 1분차트에서 5분차트에 적합이평 그리기 부탁드립니다 항상감사합니다 즐거운 주말보내십시요