kino_3MA_Ribbon

Download script
Author: mladen
kino_3MA_Ribbon

This technical indicator is designed to provide traders with a visual representation of market trends by utilizing three distinct Moving Averages (MA). It simplifies the complex movement of price data into a readable "ribbon" format, helping users identify the momentum and direction of the market at a glance.

Core Logic and Functionality

The script operates by calculating three independent averages based on different timeframes and mathematical smoothing methods. These are broken down as follows:

  • Fast Movement (Short-term): The tool tracks a very recent set of price points (set to 13 periods) using an Exponential Moving Average. This highlights immediate momentum.
  • Medium Movement (Intermediate-term): The tool tracks a slightly broader set of price points (set to 26 periods), also using an Exponential Moving Average to smooth out minor "noise" while remaining responsive to current trends.
  • Slow Movement (Long-term): The tool calculates a much larger average (set to 50 periods) using a Simple Moving Average. This acts as the anchor for the data, representing the overarching trend of the market over a longer duration.

Visual Representation

Instead of just displaying these numbers as a list, the script organizes them into a visual display on your chart:

  1. The Trend Ribbon: The core logic draws three primary lines (buffers) representing the different moving averages described above. By observing the spacing and orientation of these lines relative to one another, traders can see if the market is accelerating, slowing down, or reversing.
  2. Histogram Elements: The script also includes specific components that are rendered as histograms. These provide a different visual "weight" to the data, allowing you to distinguish between the underlying trend averages and specific calculated values at a glance.

How It Works for the User

Every time the price updates, the script automatically recalculates all three moving averages across the entire chart history. It then plots these values as a multi-layered ribbon.

  • Trend Identification: When the lines are moving in the same direction and spreading apart, it suggests a strong trend.
  • Momentum Shifts: When the fast-moving average crosses over or under the slower averages, it provides a visual cue that the market momentum may be shifting from bullish to bearish, or vice versa.
  • Customization: The logic is flexible, allowing you to adjust the periods (how many bars of data are averaged), the calculation methods (Simple vs. Exponential), and the specific price points used for the calculation to suit different trading styles.
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
15 Views
0 Downloads
0 Favorites
kino_3MA_Ribbon
//+------------------------------------------------------------------+
//|                                                    MA ribbon.mq4 |
//|                                               mladenfx@gmail.com |
//|                                                                  |
//| original idea by Jose Silva                                      |
//+------------------------------------------------------------------+
#property copyright "mladen"
#property link      "mladenfx@gmail.com"
// modified kinonen 2/2009

#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 C'0,70,0'
#property indicator_color2 C'70,0,0'
#property indicator_color3 Green
#property indicator_color4 Aqua
#property indicator_color5 Red
#property indicator_color6 Orange

#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2
#property indicator_width4 2
#property indicator_width5 2
#property indicator_width6 2

//
//
//
//
//

extern int       MA1Period=13;
extern int       MA1Method=MODE_EMA;
extern int       MA1Price =PRICE_CLOSE;
extern int       MA2Period=26;
extern int       MA2Method=MODE_EMA;
extern int       MA2Price =PRICE_CLOSE;
extern int       MA3Period=50;
extern int       MA3Method=MODE_SMA;
extern int       MA3Price =PRICE_CLOSE;

//
//
//
//
//

double buffer1[];
double buffer2[];
double buffer3[];
double buffer4[];
double buffer5[];
double buffer6[];

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
//
//
//
//
//

int init()
{
   SetIndexBuffer(0,buffer3); SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(1,buffer4); SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexBuffer(2,buffer5); SetIndexStyle(2,DRAW_HISTOGRAM);
   SetIndexBuffer(3,buffer6);
   SetIndexBuffer(4,buffer1);
   SetIndexBuffer(5,buffer2);
   
   return(0);
}
int deinit()
{
   return(0);
}

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
//
//
//
//
//

int start()
{
   int counted_bars=IndicatorCounted();
   int limit,i;
   
   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
           limit=Bars-counted_bars;

   //
   //
   //
   //
   //

   for(i=limit; i>=0; i--)
   {
      buffer1[i] = iMA(NULL,0,MA1Period,0,MA1Method,MA1Price,i);
      buffer2[i] = iMA(NULL,0,MA2Period,0,MA2Method,MA2Price,i);
      buffer3[i] = iMA(NULL,0,MA3Period,0,MA3Method,MA3Price,i);
      
      buffer6[i] = buffer3[i];
      buffer4[i] = buffer1[i];
      buffer5[i] = buffer2[i];
     
      
   }
   return(0);
}

Comments