OPEN-SOURCE SCRIPT

MACD Pro: Presets by Trading Style with Trend and Chop Filters

197
-------DESCRIPTION

There is no single best MACD setup. The right one depends on your timeframe and on how you trade.

Gerald Appel built the indicator around 12, 26 and 9 for daily and weekly charts. Put those numbers on a fast intraday chart and the signal lags behind the price action. MACD Pro carries the tested setup for each trading style, and it will pick one for you based on the chart you are on.


----------THE PRESETS

Swing (4H, daily, weekly) uses 12, 26 and 9. This is the original setup. It finds macro trends and major reversals without catching every bit of market noise.

Day trading (5m, 15m, 1H) uses 8, 17 and 9. Balanced responsiveness. It cuts the lag on intraday charts while keeping enough smoothing to avoid constant whipsaws.

Intraday momentum (3m, 5m) uses 5, 13 and 1. Dropping the signal length to 1 turns the signal into a direct zero-line cross, which is the sweet spot for catching quick intraday momentum pushes.

Scalping (1m, 3m) uses 3, 10 and 1. Maximum sensitivity to short-term price bursts. High frequency and noisy, so it demands strict risk management.

"Auto by timeframe" reads your chart and loads the right setup for you. Move from a 5-minute chart to a daily chart and the settings follow you. Custom is there when you want your own numbers.


-----------WHY A SIGNAL LENGTH OF 1 IS HANDLED DIFFERENTLY

An exponential average of one period returns the input unchanged. That means at a signal length of 1, the signal line sits exactly on top of the MACD line and a crossover can never fire.

In that mode the script hides the signal line and switches the trigger over to the zero-line cross. The table on the pane tells you which mode is running.


--------------THE FILTERS

200 EMA trend filter. Longs only while price is above the 200 EMA, shorts only while price is below it. A crossover that passes prints a solid triangle. A crossover that fails prints a hollow circle, so you still see that it happened and can judge it yourself.

Chop filter. The MACD is a trend-following momentum tool. In a sideways range, crossovers fire over and over, and every one of them is a whipsaw. When ADX sits under your threshold, the pane shades gray and crossovers are marked as failed. Rely on crossovers only when price is expanding or breaking out.


----------------THE HISTOGRAM AS AN EARLY WARNING

The histogram measures the distance between the MACD line and the signal line. When those bars start shrinking toward zero, momentum is exhausting, even before any crossover happens.

Bars print bright while the histogram is expanding and fade to translucent while it is contracting. A bright green run turning pale is your cue to tighten stops or take something off the table. Yellow dots mark two shrinking bars in a row if you want it called out explicitly.


--------------PAIR IT WITH STRUCTURE

Never take a MACD entry on its own. Line the signals up with breaks of support and resistance, or with an opening range breakout backed by above-average volume. The more elements in agreement, the more confidence you can carry into the trade.


---------------ALERTS

- Filtered bullish signal
- Filtered bearish signal
- Upside momentum exhausting
- Downside momentum exhausting


-----------------NOTES

Written in Pine Script version 6. Every setting is editable, so nothing here is locked to my preferences.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.