Hi,
Could someone please help translate this code from trading view into think or swim?
//@version=3
study("RSI Bands 30-50-70", shorttitle="RSI Bands 30-50-70", overlay=true)
length = input(14, title="RSI Length")
seventy = 70
fifty = 50
thirty = 30
ep = 2 * length - 1
auc = ema( max( close - close[1], 0 ), ep )
adc = ema( max( close[1] - close, 0 ), ep )
x1 = (length - 1) * ( adc * thirty / (100-thirty) - auc)
thirtyrsi = iff( x1 >= 0, close + x1, close + x1 * (100-thirty)/thirty )
x7 = (length - 1) * ( adc * seventy / (100-seventy) - auc)
seventyrsi = iff( x7 >= 0, close + x7, close + x7 * (100-seventy)/seventy )
x13 = (length - 1) * ( adc * fifty / (100-fifty) - auc)
fiftyrsi = iff( x13 >= 0, close + x13, close + x13 * (100-fifty)/fifty )
thirtyrsiplot = plot( thirtyrsi, title="30", color=#00FF00, linewidth=3)
fiftyrsiplot = plot( fiftyrsi, title="50", color=#5280E9, linewidth=2)
seventyrsiplot = plot( seventyrsi, title="70", color=#FE0301, linewidth=3)
Could someone please help translate this code from trading view into think or swim?
//@version=3
study("RSI Bands 30-50-70", shorttitle="RSI Bands 30-50-70", overlay=true)
length = input(14, title="RSI Length")
seventy = 70
fifty = 50
thirty = 30
ep = 2 * length - 1
auc = ema( max( close - close[1], 0 ), ep )
adc = ema( max( close[1] - close, 0 ), ep )
x1 = (length - 1) * ( adc * thirty / (100-thirty) - auc)
thirtyrsi = iff( x1 >= 0, close + x1, close + x1 * (100-thirty)/thirty )
x7 = (length - 1) * ( adc * seventy / (100-seventy) - auc)
seventyrsi = iff( x7 >= 0, close + x7, close + x7 * (100-seventy)/seventy )
x13 = (length - 1) * ( adc * fifty / (100-fifty) - auc)
fiftyrsi = iff( x13 >= 0, close + x13, close + x13 * (100-fifty)/fifty )
thirtyrsiplot = plot( thirtyrsi, title="30", color=#00FF00, linewidth=3)
fiftyrsiplot = plot( fiftyrsi, title="50", color=#5280E9, linewidth=2)
seventyrsiplot = plot( seventyrsi, title="70", color=#FE0301, linewidth=3)