Super trend and 2 EMA cross over strategy Need code to test in PI

HI All,
Below is the description of the strategy shared by my friend . Need help in code to test in PI can anyone help me pls

Plot Supertrend indicator (11,2) on a chart, followed by EMA 8 and EMA 15.
Timeframe
This trading strategy can be traded on any timeframe. However recommended timeframe should be 1 hour or more.

Buy
Buy when 8 EMA crosses 15 EMA from below upwards and Supertrend indicator has alreday given a buy signal within the last two candles. If supertrend indicator gives a buy signal just after the bullish EMA crossover (<3 candles), it’s also a buy.

Sell
Sell when 8 EMA crosses 15 EMA from above downwards and Supertrend indicator has given a sell signal within the last two candles. If supertrend indicator gives a buy signal just after the bearish EMA crossover (<3 candles), it’s a sell again

Stoploss and Trails
Stoploss to be placed at the lower or upper peak of the Supertrend signal. Trailing is done along with Supertrend indicator graph.

Exit and Profit/Loss booking
Any reverse signal by EMA crossover or Supertrend indicator is an exit. No profit booking rule is set, and positions to continue as long as we don’t get a exit signal or get stopped out.

SUPERTREND is not a supported function on Tradescript Language used in Zerodha Pi.

Tradescript is used for generating signals and does not support plotting on charts.