커뮤니티

EL 식인데 YT 로 변환 부탁드립니다.

프로필 이미지
ewy
2010-03-15 20:06:21
605
글번호 28679
답변완료
{ Type: User Function, Name: calcB } Inputs: Length(Numeric); Vars: X(0); X = BarNumber; Value1 = Summation(X * Close, Length) - (Length * Average(X, Length) *Average(Close, Length)); Value2 = Summation(Square(X), Length) - (Length * Square(Average(X, Length))); calcB = Value1/Value2; { Type: User Function, Name: calcA } Inputs: Length(Numeric); Vars: X(0); X = BarNumber; calcA = Average(Close, Length) - (calcB(Length) * Average(X, Length)); { Type: Indicator, Name: Std Error Bands Smooth } Inputs: Length(21), SDeg(3); Vars: LinRegY(0), X(0), StdErr(0), LinRegS(0), SErr(0); LinRegY = LinearRegValue(Close, Length, 0); X = CurrentBar; IF CurrentBar > Length then Begin Value1 = (Summation(Square(Close), Length)) - ((calcA(Length) * Summation(Close, Length))) - ((calcB(Length) * Summation(X * Close, Length))); Value2 = Length - 2; StdErr = SquareRoot(Value1 / Value2); LinRegS = Average(LinRegY, SDeg); SErr = 2 * Average(StdErr, SDeg); Plot1(LinRegS, "LinRegS"); Plot2(LinRegS + SErr, "+StdErrS"); Plot3(LinRegS - SErr, "-StdErrS"); End;
지표
답변 1
프로필 이미지

예스스탁 예스스탁 답변

2010-03-16 12:49:30

안녕하세요 예스스탁입니다. Inputs: Length(21), SDeg(3); Vars: LinRegY(0), X(0), StdErr(0), LinRegS(0), SErr(0), inx(0),calcB(0),calcA(0); inx = inx+1; Value1 = AccumN(inx * Close, Length) - (Length * ma(inx, Length) *ma(Close, Length)); Value2 = AccumN(Square(inx), Length) - (Length * Square(ma(inx, Length))); calcB = Value1/Value2; calcA = Average(Close, Length) - (calcB * ma(inx, Length)); LinRegY = LinearRegValue(Close, Length, 0); X = CurrentBar; IF CurrentBar > Length then Begin Value4 = (AccumN(Square(Close), Length)) - ((calcA * AccumN(Close, Length))) - ((calcB * AccumN(X * Close, Length))); Value5 = Length - 2; StdErr = SquareRoot(Value4 / Value5); LinRegS = Ma(LinRegY, SDeg); SErr = 2 * ma(StdErr, SDeg); Plot1(LinRegS, "LinRegS"); Plot2(LinRegS + SErr, "+StdErrS"); Plot3(LinRegS - SErr, "-StdErrS"); End; 즐거운 하루되세요 > ewy 님이 쓴 글입니다. > 제목 : EL 식인데 YT 로 변환 부탁드립니다. > { Type: User Function, Name: calcB } Inputs: Length(Numeric); Vars: X(0); X = BarNumber; Value1 = Summation(X * Close, Length) - (Length * Average(X, Length) *Average(Close, Length)); Value2 = Summation(Square(X), Length) - (Length * Square(Average(X, Length))); calcB = Value1/Value2; { Type: User Function, Name: calcA } Inputs: Length(Numeric); Vars: X(0); X = BarNumber; calcA = Average(Close, Length) - (calcB(Length) * Average(X, Length)); { Type: Indicator, Name: Std Error Bands Smooth } Inputs: Length(21), SDeg(3); Vars: LinRegY(0), X(0), StdErr(0), LinRegS(0), SErr(0); LinRegY = LinearRegValue(Close, Length, 0); X = CurrentBar; IF CurrentBar > Length then Begin Value1 = (Summation(Square(Close), Length)) - ((calcA(Length) * Summation(Close, Length))) - ((calcB(Length) * Summation(X * Close, Length))); Value2 = Length - 2; StdErr = SquareRoot(Value1 / Value2); LinRegS = Average(LinRegY, SDeg); SErr = 2 * Average(StdErr, SDeg); Plot1(LinRegS, "LinRegS"); Plot2(LinRegS + SErr, "+StdErrS"); Plot3(LinRegS - SErr, "-StdErrS"); End;