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).
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
////////////////////////////////////////////////////////////
//  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")
Donate BTC: 13fXLkhWuGMXRmcvwkG2gaWKcnsiD88bwE
USDT (TRC20): TH29EEXa19vfwZNYvxdUuMxoFY5QDYLcWG

Related Ideas

Comments

Thank you for this script, I really like it but it seems to be lacking behind. Somedays there is no visual and after a few days the indicator catches up.
Reply
HPotter koriblion
@koriblion, Hm... can you show screen?
Reply
koriblion HPotter
@HPotter, So i noticed it on BTC/EUR, here is the screenshot:
I checked it on other brokers to be sure that it isn't a broker issue and found out the same.
You can see the issue also when using the Replay button. Its not only in crypto. Had the same in Forex, stocks and gold & silver.
Settings are the standard and nothing has been modified on your script.

After a few days it jumps back to current day and draws the lines like nothing happend. But in that "gap" of a few days you don't see the signals.
Hope this helps!
Reply
HPotter koriblion
@koriblion, Can you check it on the ES1! symbol please?
Reply
koriblion HPotter
@HPotter, I tried to check the ES1! It looked to be ok there but there is no replay function to see if it happend. I checked ESH2021 (under ES like ES1!) this has a replay function and it has the same result:

I also have the feeling that on every "sharp move" you see on the T3 indicator that this "gap" happens like you can see here and this is the ES1!

Hope this helps!
Reply
HPotter koriblion
@koriblion, Also you can to try send report to support. It can be useful.
Reply
koriblion HPotter
@HPotter, did send a ticket to support as requested :)
Reply
koriblion HPotter
@HPotter, I got a response back from support:

------------------------------------------------------------------------------------------------
Hello again Kori!

So there these lines in the code:

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")

It's a condition, like a ternary operator basically. The script has an algorithm that calculates the average of different EMAs, then it compares these averages between bars and if the difference is above 10 it plots NA. This is exactly what happened with cryptos there.

Thank you for your understanding. Stay safe and have a great week ahead!
------------------------------------------------------------------------------------------------

Hope this helps! I tried to redo the code but couldn't figure it out without messing it up :/
Reply
HPotter koriblion
@koriblion, Ok. Give me a time for think.
Reply
koriblion HPotter
@HPotter, Ofcourse, take your time!
Reply
Home Stock Screener Forex Screener Crypto Screener Economic Calendar About Chart Features Pricing Refer a friend House Rules Help Center Website & Broker Solutions Widgets Charting Solutions Lightweight Charting Library Blog & News Twitter
Profile Profile Settings Account and Billing Referred friends Coins My Support Tickets Help Center Private Messages Chat Sign Out