How to code following Opening trade

Can you please help me in creating expert adviser for following conditions in pi


  1. After market opening wait for 5 minutes

  2. at that time check the advances and declines on NSE

  3. If advances are more than declines then

  4. Select the first 20 scrips from Nifty futures list which have advanced based on the top gainers

  5. Check the high of the scrip in first five minute candle

  6. Buy above the Highest high of the scrip (Buy the scrip which has crossed the highest high made in the first 5 minutes) i.e. buy the scrip after 5 minutes or whenever the scrip crosses that highest high.

  7. Put a stop after buying the scrip @ 0.2% of the scrip price.

  8. If the SL is not hit then adjust the stop to the next 5 minute candle low.

  9. Do this only once during the day.

I will be grateful if you can code this for me or guide me.

If you want to code above tasks of manual intervention you have to go with programming languages such as python etc., also you need to have necessary APIs or sources which gives you the required information such as top gainers etc.,