Speed2_pips_001
Download scriptThis tool is designed to analyze market velocity by tracking specific price movements over time. Rather than looking at every minor fluctuation in the market, it focuses on identifying significant "jumps" in price and visualizing their momentum.
How the Logic Works
The script monitors the relationship between current prices and previous prices across different time intervals. Here is a breakdown of its core logic:
- Price Movement Tracking: The system looks at the difference in price between the current candle and the preceding one. It converts these values into "pips"—a standard unit of measure for price movement—to ensure consistency across different currency pairs or assets.
- Dynamic Filtering: To filter out "market noise" (small, insignificant movements), the tool uses two user-defined boundaries: a minimum and a maximum threshold.
- If a price move is too small (below the minimum), the script ignores it.
- If a price move is excessively large (above the maximum), it is also filtered out to prevent extreme outliers from distorting the data.
- Significant Move Identification: The script only records data when a price change falls within your preferred "active zone." When a qualifying move occurs, the tool captures the magnitude of that specific change.
- Momentum Calculation: The tool doesn't just show the raw difference; it calculates a running cumulative value. By subtracting the previous result from the current one, it identifies the net speed or "acceleration" of the price movement.
What This Means for the User
Instead of a cluttered chart showing every tiny tick, this indicator provides a cleaner view of significant market activity. It highlights the speed at which the price is moving during meaningful trends, helping you visualize whether the market is experiencing a sustained surge or if the momentum is slowing down.
//+------------------------------------------------------------------+
//| Speed.mq4 |
//| Copyright © 2005, MetaQuotes Software Corp. |
//| http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net/"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 LightSeaGreen
extern int pips_min=10;
extern int pips_max=300;
//---- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorShortName("(C0-C1)");
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Accumulation/Distribution |
//+------------------------------------------------------------------+
int start()
{
int i,n,Bars1,counted_bars=IndicatorCounted();
RefreshRates();
//----
//i=0;
//n=Bars-counted_bars-1;
//while(i<=n)
Bars1=Bars/2;
i=Bars1;//Bars-counted_bars-1;
while(i>=0)
{
double high0 =High[i];
double low0 =Low[i];
double open0 =Open[i];
double close0=Close[i];
double pips0=close0/Point;
double vol0=Volume[i];
double high1 =High[i+1];
double low1 =Low[i+1];
double open1 =Open[i+1];
double close1=Close[i+1];
double pips1=close1/Point;
double vol1=Volume[i+1];
double high2 =High[i+2];
double low2 =Low[i+2];
double open2 =Open[i+2];
double close2=Close[i+2];
double pips2=close2/Point;
double vol2=Volume[i+2];
double vit1=(close0-close1)/(vol0-vol1);
double vit2=(close1-close2)/(vol1-vol2);
//ExtMapBuffer1[i]=ExtMapBuffer1[i+1]+Volume[i];
if (((pips0-pips1)>pips_min) && ((pips0-pips1)<pips_max) )
ExtMapBuffer1[i]=(pips0-pips1);//(close0-close1);//vit1; //(close-low)-(high-close);
else
ExtMapBuffer1[i]=0;
/*
if(ExtMapBuffer1[i]!=0)
{
double diff=high-low;
if(0==diff)
ExtMapBuffer1[i]=0;
else
{
ExtMapBuffer1[i]/=diff;
ExtMapBuffer1[i]*=Volume[i];
}
}*/
if(i<Bars1-1)
ExtMapBuffer1[i]-=ExtMapBuffer1[i+1];
i--;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments