Supertrend positional strategy

Need streak code for following conditions

BUY CONDITIONS

  1. 5min ago close less than 5min ago supertrend 3,1
  2. 5min close greater than 5min supertrend 3,1
  3. DRAR >0

DRAR = ( close - MA(C, 1500))*100/ MA(C, 1500)
MA(C, 1500) IS THE MOVING AVERAGE CLOSE with a period of 1500

Exit Rule whenever closes below supertrend

Whenever the above buy conditions r satisfied it should give buy signal and exit according to exit Rule

SELL CONDITIONS

REVERSE OF BUY SIGNAL

Anyone pls help me to get streak code for future stock options and index options ATM