WPRslow_v1

This tool is designed to function as a visual trend and momentum indicator for financial charts. It operates by analyzing the Williams %R (WPR), a common technical analysis metric that measures whether an asset is overbought or oversold based on its price range over a specific period.

How the Logic Works

Instead of showing you a standard fluctuating line, this script transforms the raw data into a clear, visual histogram consisting of blue and red bars. It simplifies complex market movements into two distinct signals:

1. Data Processing and Smoothing The indicator looks at a specific window of historical price data (defined by the period parameter). It takes the Williams %R value, squares it (multiplies it by itself), and scales it down to create a unique modified value. This mathematical approach helps in filtering out minor market "noise" to focus on more significant momentum shifts.

2. Threshold Identification The script uses three main customizable thresholds to decide when to trigger a visual signal:

  • Upper Boundary: If the processed value exceeds a specific high limit, the indicator identifies a potential downward momentum shift.
  • Lower Boundary: If the processed value falls below a specific low limit, it identifies a potential upward momentum shift.
  • Neutral Zone: Values falling between these two limits are ignored and do not produce any bars on the chart.

3. Visual Output The final result is displayed in a separate window at the bottom of your trading platform:

  • Blue Bars: These appear when the market momentum suggests strength or an upward trend relative to your set parameters.
  • Red Bars: These appear when the momentum suggests weakness or a downward trend.

Summary for the Trader

Essentially, this script acts as a "filter." Rather than showing you every small price wiggle, it waits for the momentum to reach specific extremes. When the market moves aggressively enough in one direction to cross your defined boundaries, the indicator highlights that movement with a colored bar, allowing you to see clear trends of buying or selling pressure at a glance.

Indicators Used
Larry William percent range indicator
Miscellaneous
Implements a curve of type %1
20 Views
0 Downloads
0 Favorites
WPRslow_v1
/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

//+------------------------------------------------------------------+
//|                                                      WPRslow.mq4 |
//|                                                                  |
//|                                        Ramdass - Conversion only |
//+------------------------------------------------------------------+
#property  copyright "Author - OlegVS"

#property indicator_separate_window
#property indicator_minimum -1.000000
#property indicator_maximum 1.000000
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters
extern int P=54;
extern int n1=9;
extern int n2=49;
extern int CountBars=300;
//---- buffers
double Up[];
double Down[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- indicator line
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2,Blue);
   SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2,Red);
   SetIndexBuffer(0,Up);
   SetIndexBuffer(1,Down);
//----
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| WPRslow                                                          |
//+------------------------------------------------------------------+
int start()
  {
   if (CountBars>Bars) CountBars=Bars;
   SetIndexDrawBegin(0,Bars-CountBars+P);
   SetIndexDrawBegin(1,Bars-CountBars+P);
   int i,counted_bars=IndicatorCounted();
   double V1,V2;
//----
   if(CountBars<=P) return(0);
//---- initial zero
   if(counted_bars<1)
   {
      for(i=1;i<=P;i++) Up[CountBars-i]=0.0;
      for(i=1;i<=P;i++) Down[CountBars-i]=0.0;
   }
//----
   i=CountBars-P-1;
   while(i>=0)
     {
Down[i]=0.0; Up[i]=0.0;       
V1=iWPR(NULL,0,P,i)*iWPR(NULL,0,P,i)/100;
V2=MathCeil(V1);
if (V2<n1) {Up[i]=V2;}
if (V2>n2) {Down[i]=-(V2);} 
	
      i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+

Comments