Author: Copyright � 2006, Victor Chebotariov
go

This script is a custom financial tool designed to track and visualize the flow of money and market activity within a specific timeframe. Instead of looking at simple price movements, it focuses on "Accumulation and Distribution," which helps traders understand whether buying or selling pressure is dominating the market.

How the Logic Works

1. Data Smoothing (The Foundation) Rather than reacting to every tiny, erratic flicker in the price, the script uses a specific calculation method called a Moving Average. It looks back over a set period of time (defined by the user) to determine the "average" high, low, opening, and closing prices. By using these averages as its foundation, the script filters out market "noise," providing a smoother and more reliable trend line for analysis.

2. Measuring Price Movement The logic calculates the relationship between four key price points: the Open, High, Low, and Close. Specifically, it measures how far the price traveled from the opening point to the peak (high), the valley (low), and the final closing price. By comparing these distances, the script identifies the "reach" of the price action during a specific period.

3. Incorporating Volume The most critical part of this logic is that it doesn't just look at price; it multiplies those price movements by the Trading Volume. This is essential because a small price move on high volume often signifies much stronger conviction from traders than a large price move on low volume.

The Final Result

By combining smoothed price averages with total trading volume, the script produces a single line in a separate window on your chart.

  • When the line trends upward, it suggests that buyers are aggressively pushing the price up with significant volume (Accumulation).
  • When the line trends downward, it suggests that sellers are dominating the market and offloading assets (Distribution).

Essentially, this tool acts as a "momentum gauge," helping you see the underlying strength behind a price move rather than just watching where the price ends up.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
13 Views
0 Downloads
0 Favorites
go
//+------------------------------------------------------------------+
//|                                                           go.mq4 |
//|                             Copyright © 2006, Victor Chebotariov |
//|                                      http://www.chebotariov.com/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Victor Chebotariov"
#property link      "http://www.chebotariov.com/"

extern int period = 174;
extern int ma_shift = 0;

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 LightSeaGreen
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   IndicatorShortName("GO");
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Accumulation/Distribution                                        |
//+------------------------------------------------------------------+
int start()
  {
   int i,counted_bars=IndicatorCounted();
//----
   i=Bars-counted_bars-1;
   while(i>=0)
     {
      double high =iMA(NULL,0,period,ma_shift,MODE_SMA,PRICE_HIGH,i);
      double low  =iMA(NULL,0,period,ma_shift,MODE_SMA,PRICE_LOW,i);
      double open =iMA(NULL,0,period,ma_shift,MODE_SMA,PRICE_OPEN,i);
      double close=iMA(NULL,0,period,ma_shift,MODE_SMA,PRICE_CLOSE,i);
       ExtMapBuffer1[i]=((close-open)+(high-open)+(low-open)+(close-low)+(close-high))*Volume[i];
      i--;
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments