Author: Mistral, 2006
AV_v1

The AV indicator is a specialized technical analysis tool designed to help traders visualize momentum and price movement trends within the MetaTrader platform. Its primary purpose is to identify the speed and direction of price changes by calculating specific mathematical relationships between historical data points.

Core Logic and Functionality

The script functions by analyzing "price candles" over a user-defined period (the Wide parameter). It breaks down market movement into three distinct components:

  • Midpoint Tracking: The tool identifies the middle point of price action for specific intervals. By comparing the current midpoint to the midpoint of a previous period, it creates a baseline for how "fast" or "slow" the market is moving in its current direction.
  • Volatility and Range Analysis: The logic calculates the difference between highs and lows across different timeframes. It specifically tracks:
    1. The variance in midpoints.
    2. The expansion of the lower price boundaries (Lows).
    3. The expansion of the upper price boundaries (Highs).
  • Momentum Velocity: By taking these variances and dividing them by the chosen timeframe width, the script generates a "velocity" reading. This helps traders see not just where the price is going, but how much energy or momentum is behind that movement.

Visual Representation

The indicator offers two primary viewing modes controlled by the Acc parameter:

  1. VI Mode (Volatility Indicator): When this mode is active, the script focuses on showing the momentum lines. It displays three distinct lines representing the "Medium," "Low," and "High" movements of the market's velocity. These appear as solid lines and dotted lines, providing a multi-layered view of price strength.
  2. AI Mode (Accumulation/Interaction): This mode switches the focus to the rate of change between consecutive intervals. It emphasizes the acceleration or deceleration of the market, highlighting how much the price has shifted from one "Wide" period to the next.

How it Assists Trading

Instead of looking at raw price numbers, this script translates those numbers into a visual representation of market "speed." By observing the interaction between the three different lines (Medium, Low, and High), traders can attempt to spot:

  • Trend Strength: When all lines are moving aggressively in one direction.
  • Exhaustion: When the gap between the high and low momentum lines begins to narrow significantly.
  • Momentum Shifts: When the velocity of the price movement begins to flatten out, even if the price is still technically moving in the same direction.
Miscellaneous
Implements a curve of type %1
11 Views
0 Downloads
0 Favorites
AV_v1
//+------------------------------------------------------------------+
//|                                                           AV.mq4 |
//|                                        Copyright © 2006, Mistral |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Mistral, 2006"
#property link      ""
//----
#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1 LavenderBlush
#property indicator_color2 Red
#property indicator_color3 Green
#property indicator_color4 LavenderBlush
#property indicator_color5 Red
#property indicator_color6 Green
//---- input parameters
extern int Acc=0;
extern int Wide=2;
//---- buffers
double AIB1[];
double AIB2[];
double AIB3[];
double VIB1[];
double VIB2[];
double VIB3[];
//+------------------------------------------------------------------+
//| AVc indicator initialization function                            |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   string short_name;
   if (Acc==0)
     {
      SetIndexStyle(0,DRAW_NONE);
      SetIndexStyle(1,DRAW_NONE);
      SetIndexStyle(2,DRAW_NONE);
      SetIndexStyle(3,DRAW_LINE);
      SetIndexStyle(4,DRAW_LINE,STYLE_DOT);
      SetIndexStyle(5,DRAW_LINE,STYLE_DOT);
      short_name="VI("+Wide+")";
     }
   if (Acc==1)
     {
      SetIndexStyle(0,DRAW_LINE);
      SetIndexStyle(1,DRAW_LINE,STYLE_DOT);
      SetIndexStyle(2,DRAW_LINE,STYLE_DOT);
      SetIndexStyle(3,DRAW_NONE);
      SetIndexStyle(4,DRAW_NONE);
      SetIndexStyle(5,DRAW_NONE);
      short_name="AI("+Wide+")";
     }
   SetIndexBuffer(0,AIB1);
   SetIndexBuffer(1,AIB2);
   SetIndexBuffer(2,AIB3);
   SetIndexBuffer(3,VIB1);
   SetIndexBuffer(4,VIB2);
   SetIndexBuffer(5,VIB3);
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name+"M");
   SetIndexLabel(1,short_name+"L");
   SetIndexLabel(2,short_name+"H");
   SetIndexLabel(3,short_name+"M");
   SetIndexLabel(4,short_name+"L");
   SetIndexLabel(5,short_name+"H");
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| AV indicator deinitialization function                           |
//+------------------------------------------------------------------+
int deinit()
  {
//----
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| AV indicator iteration function                                  |
//+------------------------------------------------------------------+
int start()
  {
   int      i,j,counted_bars=IndicatorCounted();
   double   mp1,mp2;
//----
   if(Bars<=(Wide*2)) return(0);
//---- initial zero
   if(counted_bars<1)
      for(i=1;i<=(Wide*2);i++) AIB1[Bars-i]=0.0;AIB2[Bars-i]=0.0;AIB3[Bars-i]=0.0;VIB1[Bars-i]=0.0;VIB2[Bars-i]=0.0;VIB3[Bars-i]=0.0;
//----
   i=Bars-Wide-1;
   if(counted_bars>=Wide) i=Bars-counted_bars-1;
   j=i-Wide;
   while(i>=0)
     {
      mp1=High[i]-(High[i]-Low[i])/2;
      mp2=High[i+Wide]-(High[i+Wide]-Low[i+Wide])/2;
      VIB1[i]=(mp1-mp2)*100/Wide;
      VIB2[i]=(Low[i]-Low[i+Wide])*100/Wide;
      VIB3[i]=(High[i]-High[i+Wide])*100/Wide;
      if (i==0) VIB1[i]=(Bid-mp2)*100/Wide;
      if (i<=j) AIB1[i]=(VIB1[i]-VIB1[i+Wide])/Wide;AIB2[i]=(VIB2[i]-VIB2[i+Wide])/Wide;AIB3[i]=(VIB3[i]-VIB3[i+Wide])/Wide;
      i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+

Comments