SeaSide420

TC True Strength Indicator

created by StevenH and SeaSide420
開源腳本

本著真正的TradingView精神,該腳本的作者將其開源發布,以便交易者可以理解和驗證它。為作者喝彩吧!您可以免費使用它,但在出版物中重複使用此代碼受網站規則的約束。 您可以收藏它以在圖表上使用。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想在圖表上使用此腳本?
//@version=2 
//                                                created by StevenH and SeaSide420
study("TC True Strength Indicator", shorttitle="TSI")
long = input(title="Long Length", type=integer, defval=35)
short = input(title="Short Length", type=integer, defval=35)
signal = input(title="Signal Length", type=integer, defval=13)
linebuy = input(title="Upper Line", type=integer, defval=4)
linesell = input(title="Lower Line", type=integer, defval=-4)
price = close
double_smooth(src, long, short) =>
    fist_smooth = ema(src, long)
    ema(fist_smooth, short)
pc = change(price)
double_smoothed_pc = double_smooth(pc, long, short)
double_smoothed_abs_pc = double_smooth(abs(pc), long, short)
tsi_value = 100 * (double_smoothed_pc / double_smoothed_abs_pc)
keh = tsi_value>linesell?lime:orange
teh = ema(tsi_value, signal)>linebuy?orange:red
meh = ema(tsi_value, signal)>tsi_value?red:lime
plot(tsi_value, color=keh, linewidth=2)
plot(ema(tsi_value, signal), color=teh, linewidth=2)
plot(linebuy,color=green),plot(linesell,color=red)
plot(cross(tsi_value, ema(tsi_value, signal)) ? tsi_value : na, style = circles, color=meh, linewidth = 3)
hline(0, title="Zero")