Script that can place a pending order to be executed at next candle opening

hi guys

can any one recommend me a script that can place a pending order to be executed at the exact price of the next candle opening (a script that can monitor the market and as soon as one candle closes and another opens place a order).

im trying to follow a trading strategy where if conditions are met you place a order when the next candle opens. but in my demo account new candle always pops up with a big body (does not start with a small candle and grows with time)and the current price it shows is way past its opening price. I don’t know why this is may be there is lot of volatility or may be because im trading 4hour charts.but it is making me loose pips

so if any one knows a script that can can place a pending order to be executed at the exact price of the next candle opening or a setting you can change in MT4 to change this behavior please share it with me

thanks