You can copy paste the code or download or refer the screenshot.
Please make sure everything is in order as seen in the screen shot below. Make sure there are 4 spaces before "strategy.entry" and "strategy.exit". Also change the "Order size" to 100% equity in settings(screenshot in the bottom)
Contact us at "[email protected]" if there are any questions

 

Download

//@version=4

strategy("id", overlay=true)
//Defining the inside day
id = high[1]>high[0] and low[1]<low[0]
//Preparing exit condition
rsiv=rsi(close,5)
if id
strategy.entry("long",strategy.long)

//Declaring percentage numbers
SL = 0.05
TP = 0.10

//Calculating the esit price for sl and tp
longstop=strategy.position_avg_price*(1-SL)
longprofit=strategy.position_avg_price*(1+TP)

//For short positions
//shortstop=strategy.position_avg_price*(1+SL)
//shortprofit=strategy.position_avg_price*(1-TP)

//for long positions
if strategy.position_size>0
strategy.exit(id = "close",stop=longstop,limit=longprofit)

//For short positions
//if strategy.position_size<0
//strategy.exit(id = "closeshort",stop=shortstop,limit=shortprofit)