mt4 ea code for checking the last few MACD histogram bars

 

Hi,

I am looking for help on the following:-

 

I want to check the previous values of MACD Histogram Values and if the slope is pointing up, i want to buy and if pointing down i want to sell.

any help would be appreciated. 

Reason: