HPotter

T3 3 Averages

This function is an Pine version of the moving average described in
the January, 1998 issue of S&C magazine, p.57, "Smoothing Techniques
for More Accurate Signals", by Tim Tillson. It is translated from the
MetaStock code presented in the article. The function uses a version
of the XAverage, written by me, which allows variables as inputs.

The most popular method of interpreting a moving average is to compare
the relationship between a moving average of the security's price with
the security's price itself (or between several moving averages).

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 21/05/2014
// This function is an Pine version of the moving average described in
// the January, 1998 issue of S&C magazine, p.57, "Smoothing Techniques
// for More Accurate Signals", by Tim Tillson. It is translated from the
// MetaStock code presented in the article. The function uses a version
// of the XAverage, written by me, which allows variables as inputs.
// The most popular method of interpreting a moving average is to compare
// the relationship between a moving average of the security's price with
// the security's price itself (or between several moving averages).
////////////////////////////////////////////////////////////
study(title="T3 3 Averages", shorttitle="T3")
Length = input(5, minval=1)
hline(0, color=gray, linestyle=line)
xPrice = close
xe1 = ema(xPrice, Length)
xe2 = ema(xe1, Length)
xe3 = ema(xe2, Length)
xe4 = ema(xe3, Length)
xe5 = ema(xe4, Length)
xe6 = ema(xe5, Length)
b = 0.7
c1 = -b*b*b
c2 = 3*b*b+3*b*b*b
c3 = -6*b*b-3*b-3*b*b*b
c4 = 1+3*b+b*b*b+3*b*b
nT3Average = c1 * xe6 + c2 * xe5 + c3 * xe4 + c4 * xe3
nSlope = nT3Average - nT3Average[2]
Res1 = nSlope
Res2 = nSlope[1]
Res3 = nT3Average - nT3Average[1]
plot(iff(Res2 > 10 or Res3 > 10,na, Res1), color=blue, title="Slope")
plot(iff(Res2 > 10 or Res3 > 10,na, Res2), color=red, title="Slope2")
plot(iff(Res2 > 10 or Res3 > 10,na, Res3), color=green, title="Slope1per")