커뮤니티

문의 드립니다

프로필 이미지
돈크돈어
2012-09-21 13:50:05
288
글번호 54939
답변완료
적응이동평균을 사용하여 macd (오실레이터 포함)을 작성하는 지표식과, 볼린져밴드 지표식 부탁드립니다
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2012-09-21 18:23:09

안녕하세요 예스스탁입니다. 1. Inputs: Period1(5),Period2(20); var : Diff(0),Fastest(0.6667), Slowest(0.0645); Var : Noise1(0), Signal1(0), efRatio1(0), Smooth1(1), AdaptMA1(0); var : Noise2(0), Signal2(0), efRatio2(0), Smooth2(1), AdaptMA2(0); Diff = AbsValue(Close - Close[1]); IF CurrentBar <= Period2 Then { AdaptMA1 = Close; AdaptMA2 = Close; } IF CurrentBar > Period2 Then Begin Signal1 = AbsValue(Close - Close[Period1]); Noise1 = accumN(Diff, Period1); efRatio1 = Signal1 / Noise1; Smooth1 = Power(efRatio1 * (Fastest - Slowest) + Slowest, 2); AdaptMA1 = AdaptMA1[1] + Smooth1 * (Close - AdaptMA1[1]); Signal2 = AbsValue(Close - Close[Period2]); Noise2 = accumN(Diff, Period2); efRatio2 = Signal2 / Noise2; Smooth2 = Power(efRatio2 * (Fastest - Slowest) + Slowest, 2); AdaptMA2 = AdaptMA2[1] + Smooth2 * (Close - AdaptMA2[1]); End; plot1(AdaptMA1-AdaptMA2); plot2(0); 2. 볼린져밴드 Inputs: Period(20),Dv(2); Vars: Noise(0), Signal(0), Diff(0), efRatio(0), Smooth(1), Fastest(0.6667), Slowest(0.0645), AdaptMA(0); Var : SumSqrt(0), Emav(0), Counter(0),AVGV(0),Stdv(0),bollup(0),bollDn(0); Diff = AbsValue(Close - Close[1]); IF CurrentBar <= Period Then AdaptMA = Close; IF CurrentBar > Period Then Begin Signal = AbsValue(Close - Close[Period]); Noise = accumN(Diff, Period); efRatio = Signal / Noise; Smooth = Power(efRatio * (Fastest - Slowest) + Slowest, 2); AdaptMA = AdaptMA[1] + Smooth * (Close - AdaptMA[1]); End; If Period != 0 Then Begin Avgv = AdaptMA; SumSqrt = 0; For Counter = 0 To Period - 1 Begin SumSqrt = SumSqrt + (C[Counter] - AdaptMA) * (C[Counter] - AdaptMA); End; Stdv = SquareRoot(SumSqrt / Period); End Else Stdv = 0; bollup = AdaptMA + (Dv * stdv); bolldn = AdaptMA - (Dv * stdv); plot1(AdaptMA); plot2(bollup); plot3(bolldn); 즐거운 하루되세요 > 돈크돈어 님이 쓴 글입니다. > 제목 : 문의 드립니다 > 적응이동평균을 사용하여 macd (오실레이터 포함)을 작성하는 지표식과, 볼린져밴드 지표식 부탁드립니다