This is my personal interpretation of the classic Indicator. I am using the as part of my analysis, and often I was wondering when I can expect the next signal (e.g. a Histogram cross). As I had come across some forecast logics on tradingview, my goal was to use the forecast calculation as basis to come to a complete forecast. Here is the result.
Starting point is the classic which is then plotted with MACD-Line, Signal Line and Histogram. In addition to the classic , a 6 period Forecast for , Signal and Histogram is available and divergences can be displayed on either the Histogram or the Line.
As I am considering the closing price of the current candle as the basis for the calculation, the forecast values will REPAINT. But in my opinion this is fine as this indicator will not provide direct trading signals, but more an outlook into a potential future.
█ CALCULATION LOGIC
Below some details regarding the additional functionalities:
The Forecast is mainly based on a combination of Forecasts. The inspiration for this basic forecast calculation is taken from the below tradingview members:
--> Forecast input taken from "Triple MA Forecast" by yatrader2
--> Forecast Bias input taken from "Fancy Bands" by BigBitsIO
When showing the forecast, the following options are available:
- Forecast Type: Determines if the Forecast is assuming a Flat price (last values of the MA calculation are replaced by current value) or if a is taken
- Number of candles taken for Calculation
- Bias of Forecast (Based on the recent , the forecast values are either more or more calculated. "Neutral" turns off this function)
- Number of ATR Periods used to calculate Bias adjustment value
- Possibility to weight the Bias via a Multiplier - Default value is 1
Based on the above inputs, the forecasted values for , Signal Line and Histogram are calculated and plotted for the next 6 periods.
Based on the default tradingview divergence script with some adjustments:
- User can select to use either Histogram or Line as basis for Divergence detection (Histogram by default)
- User can select if Divergence detection should be based on the candles including Wicks or only the Candle Bodies (Wicks by default)
This is an experimental indicator and I do not know if my theory works in real life. So treat this not as financial advise, but purely for entertainment and educational purposes.
I publish this code open so that everyone can re-use it or hopefully even improve it.
Let me know if you have any ideas for improvement and if it is within my coding capabilities (which to be honest are quite limited), I will try to accomodate it.