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