MA_Gideon2

Understanding the MA_Gideon Indicator

The MA_Gideon is a custom technical analysis tool designed to provide traders with a visual representation of market momentum and trend dynamics. Rather than relying on a single price average, this script employs a multi-layered smoothing technique to filter out "market noise" and highlight the underlying direction of price movement.

How the Logic Works

The core logic of this indicator follows a hierarchical calculation process, where each layer builds upon the previous one to create increasingly refined data points:

1. The Primary Foundation (Fast Trigger) The script begins by calculating a "Fast Trigger" line. This is an Exponential Moving Average (EMA) based on the opening prices of the candles over a very short period (3 units). By focusing on the opening price, the indicator attempts to capture the initial sentiment of the market at the start of each candle.

2. The Multi-Layered Smoothing Instead of applying averages directly to the raw market price, the MA_Gideon applies its subsequent calculations to the "Fast Trigger" line created in the first step. This creates a "smoothed average of an average," which helps in identifying broader trends while remaining responsive to recent changes.

  • Slow Trigger: This line uses a Smoothed Moving Average (SMMA) applied to the Fast Trigger. It acts as a secondary filter, highlighting mid-term momentum.
  • Main Line: Also utilizing the SMMA method, this line uses a longer period to represent the dominant trend of the asset.
  • TrendOver: This final layer employs a Linear Weighted Moving Average (LWMA) on the Fast Trigger data. Because it is "weighted," it gives more importance to the most recent data points, providing a distinct perspective on how the current trend is shifting in real-time.

Visualizing the Data

The indicator populates four separate lines on a dedicated sub-window of your trading chart:

  • Fast Trigger (Blue): Represents immediate, short-term price reactions.
  • Slow Trigger (Light Blue): Provides a balanced view of intermediate momentum.
  • Main Line (Light Pink): Serves as the primary guide for the overall trend direction.
  • TrendOver (Light Green): Offers a weighted perspective on recent trend behavior.

Summary for Traders

By layering these different types of moving averages—Exponential, Smoothed, and Linear Weighted—on top of one another, the MA_Gideon aims to provide a comprehensive view of market health. It allows traders to distinguish between temporary price fluctuations and sustained trend movements by observing how these four lines interact with each other over time.

Indicators Used
Moving average indicatorMoving average indicator
Miscellaneous
Implements a curve of type %1
4 Views
0 Downloads
0 Favorites
MA_Gideon2
//+------------------------------------------------------------------+
//|                                                  MA_Gideon       |
//|                      Copyright © 2004, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property  copyright "Copyright © 2007, GideonSmolders(at)gmail.com."
#property  link      ""
//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 4
#property  indicator_color1  Blue
#property  indicator_color2  LightBlue
#property  indicator_color3  LightPink
#property  indicator_color4  LightGreen
//----
extern double slowPeriod=9;
extern double MainPeriod=35;
extern double TrendOverPeriod=14;
//---- indicator buffers
string signal;
double fastTrigger[];
double slowTrigger[];
double MainLine[];
double TrendOver[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- 2 additional buffers are used for counting.
   //   IndicatorBuffers(4);
   SetIndexDrawBegin(0,30);
   SetIndexDrawBegin(1,30);
   SetIndexDrawBegin(2,30);
   SetIndexDrawBegin(3,30);
//----
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1);
   SetIndexStyle(2,DRAW_LINE,STYLE_SOLID,1);
   SetIndexStyle(3,DRAW_LINE,STYLE_SOLID,1);
//----
   SetIndexBuffer(0,fastTrigger);
   SetIndexLabel(0,"fastTrigger");
   SetIndexBuffer(1,slowTrigger);
   SetIndexLabel(1,"slowTrigger");
   SetIndexBuffer(2,MainLine);
   SetIndexLabel(2,"Main Line");
   SetIndexBuffer(3,TrendOver);
   SetIndexLabel(3,"TrendOver");
   //   ArraySetAsSeries(fastTrigger, true);
//---- name for DataWindow and indicator subwindow label
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Calculations                                                     |
//+------------------------------------------------------------------+
int start()
  {
   //   int limit=ArraySize(fastTrigger);
   int limit;
   int i;
   int counted_bars=300;
   //   int counted_bars=IndicatorCounted();
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- main loop
//---- done
   for(i=0; i<=limit; i++)
     {
      fastTrigger[i]=  iMA(Symbol(),0,3,0,MODE_EMA,PRICE_OPEN,i);
     }
   for(i=0; i<=limit; i++)
     {
      slowTrigger[i]=iMAOnArray(fastTrigger,0,slowPeriod,0,MODE_SMMA,i);
      MainLine[i]= iMAOnArray(fastTrigger,0,MainPeriod,0,MODE_SMMA,i);
      TrendOver[i]= iMAOnArray(fastTrigger,0,TrendOverPeriod,0,MODE_LWMA,i);
     }
   //   This way also works, just slower
   //   for(i=0; i <= limit; i++) 
   //   {   
   //   MainLine[i]= iMAOnArray(fastTrigger,0,MainPeriod,0,MODE_SMMA,i);
   //   }
   //   for(i=0; i <= limit; i++) 
   //   {
   //   TrendOver[i]= iMAOnArray(fastTrigger,0,TrendOverPeriod,0,MODE_LWMA,i);
   //   }
  }
//+------------------------------------------------------------------+

Comments