Hi i want a modified pine editor script of RSI STRATEGY INDICATOR ,I want to set the target and stoploss in percentage from the entry price . example Buy Entry price=100 then the stoploss should be -1% of entry price(100), and target should be +5% of entry price(100). similarly for short trade vice versa
strategy("RSI Strategy", overlay=true) length = input( 14 )
overSold = input( 30 )
overBought = input( 70 )
price = close
vrsi = ta.rsi(price, length)
co = ta.crossover(vrsi, overSold)
cu = ta.crossunder(vrsi, overBought)
if (not na(vrsi))
if (co)
strategy.entry("RsiLE", strategy.long, comment="RsiLE")
if (cu)
strategy.entry("RsiSE", strategy.short, comment="RsiSE")