Calculte Stop Loss in tradescript

Let’s say I got a buy signal for IOC at the close of the latest signal at Rs. 360.
Then, as per my question, how can I simultaneously get a Sell signal to exit the Buy at Rs. 356.4?
Basically, in real time we can always do the math for 1% (which is time consuming),
but is there any mechanism by which the price will be calculated automatically and give an alert
(when used in EA)? Also, I need this for backtesting.