OPEN-SOURCE SCRIPT

Relative Strength Comparison 1

//version=5
indicator("Relative Strength Comparison", overlay=false)

// User Inputs
numSymbol = input.symbol("NSE:TCS", "Numerator Symbol") // Numerator security
denSymbol = input.symbol("NSE:INFY", "Denominator Symbol") // Denominator security

// Fetch security prices
numPrice = request.security(numSymbol, timeframe.period, close)
denPrice = request.security(denSymbol, timeframe.period, close)

// Calculate Relative Strength (RS)
relativeStrength = numPrice / denPrice

// Plot Relative Strength Line
plot(relativeStrength, title="Relative Strength Line", color=color.blue, linewidth=2)

Wyłączenie odpowiedzialności