MACD is a trend following indicator, so it will give whipsaws in trading range.
To avoid whipsaws do consider Stochastic also, it works perfectly in a trading range.
So basically u should use 3 indicators and they are
1. ADX (this will help you determine if its a trend or trading range).
2. MACD (If its trend then use MACD).
3. Stochastics( If its a range then use Stochastics).
See whether this helps..
:thumb: