//@version=5
indicator(title="Relative Strength Index", shorttitle="RSI", format=format.price)
// User inputs for timeframes
tf1 = input.string("1", title="Timeframe 1", options=["1", "3", "5", "15", "30", "45", "60", "120", "180", "240", "D", "W", "M", "3M", "6M", "12M"])
tf2 = input.string("3", title="Timeframe 2", options=["1", "3", "5", "15", "30", "45", "60", "120", "180", "240", "D", "W", "M", "3M", "6M", "12M"])
tf3 = input.string("5", title="Timeframe 3", options=["1", "3", "5", "15", "30", "45", "60", "120", "180", "240", "D", "W", "M", "3M", "6M", "12M"])
tf4 = input.string("15", title="Timeframe 4", options=["1", "3", "5", "15", "30", "45", "60", "120", "180", "240", "D", "W", "M", "3M", "6M", "12M"])
tf5 = input.string("30", title="Timeframe 5", options=["1", "3", "5", "15", "30", "45", "60", "120", "180", "240", "D", "W", "M", "3M", "6M", "12M"])
tf6 = input.string("60", title="Timeframe 5", options=["1", "3", "5", "15", "30", "45", "60", "120", "180", "240", "D", "W", "M", "3M", "6M", "12M"])
tf7 = input.string("D", title="Timeframe 5", options=["1", "3", "5", "15", "30", "45", "60", "120", "180", "240", "D", "W", "M", "3M", "6M", "12M"])
ha_open = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, open)
ha_high = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, high)
ha_low = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, low)
ha_close = request.security(ticker.heikinashi(syminfo.tickerid), timeframe.period, close)
cal_ha(ha_open,ha_high,ha_low,ha_close) =>
ha0 = ha_open < ha_close ? "