Need code for this stratergy

Buy- when macd histogram is below his central line and one bar moved up from previous macd histogram bar.

Sell - when macd histogram is above his central line and one bar moved down from previous macd histogram bar.

Thanks.

The above condition can not be coded in tradescript.