OPEN-SOURCE SCRIPT

Custom TSI

//version=5
indicator("Custom TSI", overlay = false)

// Input parameters for TSI settings
int longfLen = input.int(11, "Long Length", minval = 1)
int shortfLen = input.int(3, "Short Length", minval = 1)
int signalfLen = input.int(7, "Signal Length", minval = 1)

// Calculate TSI
tsi = ta.tsi(close, shortfLen, longfLen) * 100

// Calculate TSI Signal Line
tsiSignal = ta.ema(tsi, signalfLen)

// Plot TSI and Signal Line
plot(tsi, "TSI", color=color.blue, linewidth=2)
plot(tsiSignal, "Signal Line", color=color.red, linewidth=2)

// Highlight TSI crossing Signal Line
bgcolor(ta.crossover(tsi, tsiSignal) ? color.new(color.green, 90) : na, title="TSI Cross Up")
bgcolor(ta.crossunder(tsi, tsiSignal) ? color.new(color.red, 90) : na, title="TSI Cross Down")

// Alerts
alertcondition(ta.crossover(tsi, tsiSignal), title="TSI Cross Up", message="TSI has crossed above the Signal Line")
alertcondition(ta.crossunder(tsi, tsiSignal), title="TSI Cross Down", message="TSI has crossed below the Signal Line")
educationalFundamental AnalysisMoving Averages

סקריפט קוד פתוח

ברוח TradingView אמיתית, מחבר הסקריפט הזה פרסם אותו בקוד פתוח, כך שסוחרים יוכלו להבין ולאמת אותו. כל הכבוד למחבר! אתה יכול להשתמש בו בחינם, אבל השימוש החוזר בקוד זה בפרסום כפוף לכללי הבית. אתה יכול להכניס אותו למועדפים כדי להשתמש בו בגרף.

רוצה להשתמש בסקריפ זה בגרף?

כתב ויתור