Power of stock 5 ema stretegy

I want to create and backtest the strategy of power of stocks. The rules are -

Sell nifty 50 stocks when-

  1. chart time frame 5minutes
  2. Time period 5 (in simple terms its 5ema)
  3. entry when current candle close crosses below previous candle low and if that previous candle is higher than 5ema and should not be touched the 5ema line

4.Short in nifty 50 stocks

  1. target minimum 1:2.
  2. stop loss is that previous candle high or 3 ema crossed above 5 ema

Can anyone create a code in streak for above stretegy

I had some similar requirements and found this thread Backtesting 5 Ema Strategy of Power of stocks - #17 by Aditya_Gusain

I think you only require some minor changes and it should work