Yoni Yum

The Yoni Yum indicator is a sophisticated technical analysis tool designed to identify market trends while filtering out the "noise" that often makes standard indicators difficult to read. It achieves this by combining three distinct mathematical methodologies into a single, cohesive visual output.

Core Logic and Methodology

The logic operates through a multi-layered processing sequence:

1. Trend Identification (MACD Foundation) At its core, the script utilizes a modified version of the Moving Average Convergence Divergence (MACD). It calculates the distance between two different types of moving averages (fast and slow). This serves as the primary data source to determine the underlying momentum of the market.

2. Stochastic Filtering To refine this raw momentum data, the script applies a "Stochastic" logic. It looks back over a specific cycle of price history to identify the highest and lowest values achieved by the MACD. By comparing the current position against these historical highs and lows, it determines where the price currently sits within its recent range.

3. The Fisher Transformation (Signal Smoothing) This is the most advanced step in the script's logic. It applies a mathematical technique known as the Fisher Transform to the filtered data. This process is designed to convert the standard undulating curves of a market into more distinct, sharper signals. It effectively "normalizes" the data, making it easier to see when the trend is reaching an extreme or beginning to reverse.

4. Final Smoothing and Verification (The Echo) To ensure the final visual output is easy for a trader to interpret, the script performs two final actions:

  • Smoothing: It applies a very short-term moving average to the result, creating the primary "Yoni Yum" line.
  • The Echo: It generates a secondary "Echo" line, which is essentially the previous value of the main signal.

Practical Interpretation

By combining these steps, the indicator behaves similarly to a standard oscillator but with much cleaner lines. The relationship between the primary line and its "Echo" provides traders with a visual cue for momentum shifts; when the two lines move in harmony, it suggests a strong trend, while their divergence or crossover can indicate potential changes in market direction.

Indicators Used
Moving average indicatorMoving average indicator
Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
Yoni Yum
//+------------------------------------------------------------------+
//|                                                     Yoni Yum.mq4 |
//|                         Copyright © 2007, Sylvan Arinaya Gilbert |
//|             Creative Commons Attribution-Share Alike 3.0 License |
//|                   http://creativecommons.org/licenses/by-sa/3.0/ |
//|                                                                  |
//| Yoni Yum is a hybrid of the Schaff Trend Cycle (an MACD filtered |
//| through a stochastic oscillator) and Ehlers' Fisher Transform    |
//| (a stochastic modulated using the Fisher Transformation).  The   |
//| end result is similar to a stochastic oscillator, but with       |
//| significantly less signal noise.                                 |
//|                                                                  |
//| Version 1.0 - 2007/5/2                                           |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "The Countess" // For all you Tom Robbins fans.

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 DarkKhaki
#property indicator_color2 Brown
#property indicator_level1 0
//---- input parameters
extern int       fast=9;  // Fast EMA period
extern int       slow=12; // Slow EMA period
extern int       cycle=6; // Stochastic period
//---- buffers
double macdBuffer[];
double fishBuffer[];
double yoniBuffer[];
double echoBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
{
   IndicatorBuffers(4);
   SetIndexBuffer(2, macdBuffer);
   SetIndexBuffer(3, fishBuffer);
   
   SetIndexStyle(1, DRAW_LINE);
   SetIndexBuffer(1, yoniBuffer);
   SetIndexStyle(0, DRAW_LINE);
   SetIndexBuffer(0, echoBuffer);
   
   IndicatorShortName("Yoni Yum ("+fast+","+slow+","+cycle+") ");
   SetIndexLabel(1, "Signal");
   SetIndexLabel(0, "Echo");
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
{
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
{
   int limit,i,k;
   double hi,lo,val,prev;
   
   limit = Bars - slow;
   prev = 0;
   
   // MACD
   for (i = limit; i >= 0; i--)
   {
      macdBuffer[i] = iMA(NULL, 0, fast, 0, MODE_EMA, PRICE_TYPICAL, i) - 
                      iMA(NULL, 0, slow, 0, MODE_EMA, PRICE_TYPICAL, i);
   }
   
   // Stochastic / Fisher Transformation
   for (i = limit; i >= 0; i--)
   {
      // Find the high and low MACD value in the previous cycle
      hi = -1000000;
      lo = 1000000;
      for (k = 0; k < cycle; k++)
      {
         if (macdBuffer[i + k] > hi) hi = macdBuffer[i + k];
         if (macdBuffer[i + k] < lo) lo = macdBuffer[i + k];
      }
      val = ((macdBuffer[i] - lo) / (hi - lo)) - 0.5;
      
      // This is Ehlers' Fisher Transform
      val = MathMin(MathMax((val + prev) * 2/3, -0.9999), 0.9999);
      fishBuffer[i] = MathLog((1+val)/(1-val));
      
      prev = val;
   }
   
   // Smooth the result with a 2 period EMA, and plot a second line offset by one point
   for (i = limit; i >= 0; i--)
   {
      yoniBuffer[i] = iMAOnArray(fishBuffer, Bars, 2, 0, MODE_EMA, i);
      echoBuffer[i] = yoniBuffer[i + 1];
   }
   
   return(0);
}

Comments