I want to get MACD values for 30min Time-frame. As I have created the code below but it is not giving the MACD values correctly.
Orders are place every 30 minute and are liquidated in the very next 30 min candle.

Please let me know where i am doing wrong?

Thanks for the help in advance.