Banknifty stochastic code

i want to backtest stockhastic strategy

buy only when stochastic is below 25 and take only buy crossover for long

sell only when stochastic is above 80 and take only sell crossover for short sell

and auto profit take at 50 points and auto stop loss at 75 points

for the above condition

Buy Script

SOPK(9, 3, 9, SIMPLE) < 25 OR SOPD(9, 3, 9, SIMPLE) < 25

Sell Script:

SOPK(9, 3, 9, SIMPLE) > 80 OR SOPD(9, 3, 9, SIMPLE) > 80