TanHef

MTF MACD (PPO) [TANHEF]

TanHef Updated   
Mult-Timeframe Moving Average Convergence Divergence (MACD) and Percentage Price Oscillator (PPO) indicator that allows for viewing of 1 to 5 different Timeframes.

Brief Summary
The primary benefit of multi-timeframe indicators is getting better entries and confirmation from viewing multiple time frames at once, which can often get overlooked.
MACD shouldn't be only used by itself, it is a lot more consistent when applied in the same direction as the trend as well as multiple other things including support, resistance, and volume improve the outcomes of the MACD results.
Personally, I look for good entries on higher and lower time frames (multiple timeframes must agree with the buying or selling). For example, if a higher timeframe looks like a good long entry (MACD line is crossing up and below the zero line), then the lower timeframes should be checked to ensure they are not oversold or overextended (the MACD line must be low or below the zero), once the lower and higher timeframes are in agreeance an entry can be made.

What is Moving Average Convergence Divergence (MACD)?
Moving average convergence divergence (MACD) is a trend-following momentum indicator that shows the relationship between two moving averages of the price. The MACD is calculated by subtracting the 26-period exponential moving average (EMA) from the 12-period EMA.

What is the Percentage Price Oscillator (PPO)?
The PPO is identical to the MACD indicator, except the PPO measures percentage difference between two EMAs, while the MACD measures absolute (or dollar) difference. The PPO has the advantage of being comparable to other assets with different prices, whereas MACD readings are not comparable. For example, regardless of the asset's price, a PPO result of 10 means the short-term average is 10% above the long-term average.

A signal line can be displayed on Timeframe, including:
- MACD & Signal Line crosses (Green when MACD above Signal Line and Red when MACD below Signal Line)
- Histogram Direction (fast and slow EMA gap)
- SuperTrend for identifying trend direction (green for uptrend, red for downtrend)
- EMA Trend for identifying trend direction (above EMA = up trend and green, below EMA = down trend and red)

Cross Dots and Potential cross dots
- Green Dot, is displayed when the MACD crosses the Signal Line
- Red Dot, is displayed when the MACD crosses the Signal Line
- Yellow Dot. Potential cross up (green dot) on next bar. Displayed when if the same distance a MACD moves on a bar is applied to the next bar will cause a MACD and Signal Line Cross. This is calculated by checking if the value change of one bar is added to the current MACD value would lead to a cross on the next bar, the it is a potential up dot.
- Purple Dot. Potential cross down (red dot) on next bar. Displayed when if the same distance a MACD moves on a bar is applied to the next bar will cause a MACD and Signal Line Cross. This is calculated by checking if the value change of one bar is added to the current MACD value would lead to a cross on the next bar, the it is a potential down dot.

Best Fit Settings
- Can be applied to the MACD, Signal Line, and Histogram to re-scale (stretch) to fit them within the space of the +2 and -2 range that each timeframe is provided on this indicator.
- The lookback distance value is used to lookback a certain distance to ensure everything scaled to fit well.

Labels are displayed on the right of the indicators, including:
- a label identifying 'line indicator' is currently being displayed
- the Timeframe corresponding to each MACD or PPO indicator
- the MACD or PPO of each Timeframe
Release Notes:
Added divergences for the MACD Line, with the ability to display regular and hidden divergences (bullish and bearish).
'Set Bar' input allows selecting which previous bar will be used for calculating the divergence.
'Lookback Period' input allows setting total period (look back distance) checked to find the highest and lowest bars and then compared to the 'Set Bar' to find divergences.
Release Notes:
Added the ability to display MACD Divergence Lines so it is now visible entirely where the divergence is occurring, as well as the ability to modify transparency to make things more visible when overlapping.
Improved how the MACD, Signal Line, and Histogram are displayed when using the 'Best Fit' which is found within the settings of this indicator.
Release Notes:
Added a "Big Signal" which gets displayed on the background. This is customizable within the settings to include Histogram Crossing zero line (MACD and Signal Line cross), Histogram Direction, SuperTrend Direction, and EMA Trend Direction. A variety of timeframes can be required.

Green back color = bullish
Red back color = bearish

An example of the the bullish big signal (background color is green) requires:
-Histogram Cross above zero line on Timeframe #1
-Histogram moving upwards on Timeframe #4
-SuperTrend direction up trend on Timeframe #1
Release Notes:
Improved Divergence Settings
Release Notes:
Added MTF Leading Indicator. This is added within the settings through 'Additional line indicator'.
Leading indicator can be added to the 'Big Signal' within settings.
Added alerts for 'Big Signal Triggers Buy/Sell criteria. (Always back test and use a stop loss)
How to add alerts:
1. Add the indicator to the chart then, then go into its settings
2. Check off Alerts to enable
3. Create Alert
4. Set condition to "Leading"
5. Select create
Release Notes:
Added a feature to prevent repainting due to higher timeframes 'close value' occurring less often than the close of the lower timeframe.
This is done by changing the Period (via the 'TF Mult.' input). The results will be very slightly different on occasion but will prevent repainting.

How to use:
-Set each Timeframe to 'Chart' and set each TF Mult, corresponding to the desired timeframe multiple of the current chart
-For example if you want a 15 minute and 1 hour timeframe to be displayed. Set the TradingView chart to the 15 minute. Then set both #1 and #2 to 'chart', then set #2 'TF Mult.' to 4 (since 1 hour is four times longer than 15 minutes).

www.tanhef.com/

Scripts and content from TanHef are solely for information and education. Past performance does not guarantee of future results.
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?