3D Oscilator_v2

Download script
Author: Author - Luis Damiani. Ramdass - Conversion only
3D Oscilator_v2

This tool is a sophisticated technical analysis indicator designed to help traders visualize market momentum and price action trends. By combining three distinct mathematical perspectives into a single visual display, it aims to filter out "market noise" and provide a clearer picture of where the price is heading.

Core Logic Overview

The script operates by blending three different financial metrics to create a multi-layered analysis:

  • Relative Strength (RSI): It first looks at the speed and change of price movements to determine if an asset is being overbought or oversold.
  • Stochastic Analysis: It then measures where the current relative strength sits within its recent high and low range. This helps identify the "position" of the current move compared to the recent past.
  • Commodity Channel Index (CCI): Finally, it incorporates a third layer that tracks the relationship between the price and its average over a specific period.

How the Data is Processed

Rather than simply showing you three separate lines, the script performs a "weighted fusion." It takes the results of the Stochastic analysis and blends them with the Commodity Channel Index based on a specific intensity factor (defined by the "hot" parameter). This creates a unified value that represents the core momentum of the market.

Smoothing and Signal Generation

To ensure the data is readable and not jumpy, the script applies a secondary smoothing process:

  1. Primary Signal: The fused momentum data is smoothed to create a primary trend line (Signal 1).
  2. Secondary Signal: A second trend line (Signal 2) is calculated based on the first signal.

Visual Interpretation

The final output produces two distinct lines on your chart window. By observing the relationship between these two lines, traders can look for:

  • Trend Confirmation: When both lines move in the same direction.
  • Momentum Shifts: When the lines begin to diverge or cross one another, which may indicate that the current price trend is losing strength or preparing for a reversal.

Essentially, this script acts as a sophisticated "filter" that attempts to provide a smoother, more reliable view of market momentum by merging three different types of price calculations into two clean visual signals.

Indicators Used
Relative strength indexCommodity channel index
Miscellaneous
Implements a curve of type %1
17 Views
0 Downloads
0 Favorites
3D Oscilator_v2
//+------------------------------------------------------------------+
//|                                                 3D Oscilator.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Author - Luis Damiani. Ramdass - Conversion only"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters
extern int D1RSIPer = 13;
extern int D2StochPer = 8;
extern int D3tunnelPer = 8;
extern double hot = 0.4;
extern int sigsmooth = 4;
//---- buffers
double sig1n[];
double sig2n[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
    string short_name;
    //---- indicator line
    SetIndexStyle(0, DRAW_LINE);
    SetIndexStyle(1, DRAW_LINE);
    SetIndexBuffer(0, sig1n);
    SetIndexBuffer(1, sig2n);
    //----
    SetIndexDrawBegin(0, D1RSIPer + D2StochPer + D3tunnelPer + hot + sigsmooth);
    SetIndexDrawBegin(1, D1RSIPer + D2StochPer + D3tunnelPer + hot + sigsmooth);
    //----
    return(0);
  }
//+------------------------------------------------------------------+
//|   CCI_Woodies                                                    |
//+------------------------------------------------------------------+
int start()
  {
    int i, i2, counted_bars = IndicatorCounted();
    double rsi, maxrsi, minrsi, storsi, E3D, sig1, sig2, sk, ss, sk2;
    double cs;
    bool init = true;
    //----
    cs = D1RSIPer + D2StochPer + D3tunnelPer + hot + sigsmooth;
    if(Bars<=cs) 
        return(0);
    //if (init)
    //{
    ss = sigsmooth;
    if(ss < 2) 
        ss=2;
    sk = 2 / (ss + 1);
    sk2 = 2 / (ss*0.8 + 1);
    init=false;
    //---- initial zero
    if(counted_bars < 1)
      {
        for(i = 1; i <= cs; i++) 
            sig1n[Bars-i] = 0.0;
        for(i = 1; i <= cs; i++) 
            sig2n[Bars-i] = 0.0;
      }
    //----
    i = Bars - cs - 1;
    if(counted_bars >= cs) 
        i = Bars - counted_bars - 1;
    while(i >= 0)
      {
        rsi = iRSI(NULL, 0, D1RSIPer, PRICE_CLOSE, i);
        maxrsi = rsi;
        minrsi = rsi;
        for(i2 = i + D2StochPer; i2 >= i; i2--)
          {
            rsi = iRSI(NULL, 0, D1RSIPer, PRICE_CLOSE, i2);
            if(rsi > maxrsi) 
                maxrsi=rsi;
            if(rsi < minrsi) 
                minrsi = rsi;
          }
        storsi = ((rsi - minrsi) / (maxrsi - minrsi)*200 - 100);
        E3D = hot*iCCI(NULL, 0, D3tunnelPer, PRICE_TYPICAL, i) + (1 - hot)*storsi;
        sig1n[i] = sk*E3D + (1 - sk)*sig1;
        sig2n[i] = sk2*sig1 + (1 - sk2)*sig2;
        sig1 = sig1n[i];
        sig2 = sig2n[i];
        i--;
      }
    return(0);
  }
//+------------------------------------------------------------------+

Comments