This indicator is designed to help traders interpret market momentum by combining the Williams Percent Range (WPR) logic with Multi-Timeframe (MTF) analysis. Instead of looking at just one chart, it allows you to see the trend and pressure from higher timeframes directly on your current screen.
How It Works
The tool filters price action into four distinct categories based on momentum intensity. It identifies whether the market is in a "Strong" state (Overbought or Oversold) or a standard "Trend" state.
1. Bullish Sentiment (Upward Movement)
- Trend Bulls: When the market is moving upward but hasn't reached extreme heights, the indicator signals a steady bullish trend.
- Strong Bulls (Overbought): When the momentum becomes exceptionally high, it flags an overbought condition, indicating that the buying pressure may be reaching a peak.
2. Bearish Sentiment (Downward Movement)
- Trend Bears: When the market is moving downward with moderate pressure, the indicator highlights a steady bearish trend.
- Strong Bears (Oversold): When the momentum drops significantly, it flags an oversold condition, signaling that selling pressure may be reaching a bottom.
Key Features
- Multi-Timeframe Integration: One of the most powerful aspects of this script is its ability to "look ahead" at larger timeframes (such as Daily, Weekly, or Hourly charts). You can set it to monitor a higher timeframe while keeping your current chart open, helping you stay aligned with the bigger market picture.
- Visual Clarity: The logic translates complex numbers into clear visual signals. It uses different buffers to distinguish between "Normal Trends" and "Extreme Conditions," allowing traders to see at a glance whether a move is sustainable or potentially overextended.
- Customizable Sensitivity: The script includes adjustable parameters, allowing you to define your own "Overbought" and "Oversold" thresholds, as well as the period of time used to calculate the momentum.
Summary for the Trader
Essentially, this tool acts as a filter. It takes the raw data of the Williams Percent Range and organizes it into a visual map. It tells you not just where the price is going, but how hard it is pushing in that direction, across multiple timeframes simultaneously. This helps in identifying high-probability trend follows while warning you when the market might be becoming overextended.
//+------------------------------------------------------------------+
//| WPR_Filter_mtf Filter overWPR.mq4 |
//| Copyright © 2006, Indoforex Groups - Primajaya |
//| MTF:ForexTSD.com ki http://primaforex.blogspot.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Indoforex Groups"
#property link "http://primaforex.blogspot.com"
#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 1.00
#property indicator_buffers 4
#property indicator_color1 Blue
#property indicator_color2 Red
#property indicator_color3 SteelBlue
#property indicator_color4 Orange
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2
#property indicator_width4 2
//---- input parameters
extern int TimeFrame = 0;
extern int PeriodeWPR = 14;
extern double OverBoughtLevel = -20 ;//76.4;// 61.80;
extern double OverSoldLevel = -80 ; //23.6;// 38.20;
extern string _MainTrend = "-50";
extern int MaxBarsToCount = 1500;
extern string _TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN|0-CurrentTF";
//---- indicator buffers
double UpBuffer1[];
double DnBuffer1[];
double UpBuffer2[];
double DnBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
string short_name;
//---- indicator line
SetIndexStyle(0,DRAW_HISTOGRAM);
SetIndexStyle(1,DRAW_HISTOGRAM);
SetIndexStyle(2,DRAW_HISTOGRAM);
SetIndexStyle(3,DRAW_HISTOGRAM);
SetIndexBuffer(0,UpBuffer1);
SetIndexBuffer(1,DnBuffer1);
SetIndexBuffer(2,UpBuffer2);
SetIndexBuffer(3,DnBuffer2);
SetIndexLabel(0,"Overbought or Strong Bulls");
SetIndexLabel(1,"Oversold or Strong Bears");
SetIndexLabel(2,"Trend Bulls");
SetIndexLabel(3,"Trend Bears");
//----
SetIndexDrawBegin(0,PeriodeWPR);
SetIndexDrawBegin(1,PeriodeWPR);
SetIndexDrawBegin(2,PeriodeWPR);
SetIndexDrawBegin(3,PeriodeWPR);
//----
//---- name for DataWindow and indicator subwindow label
switch(TimeFrame)
{
case 1 : string TimeFrameStr="Period_M1"; break;
case 5 : TimeFrameStr="Period_M5"; break;
case 15 : TimeFrameStr="Period_M15"; break;
case 30 : TimeFrameStr="Period_M30"; break;
case 60 : TimeFrameStr="Period_H1"; break;
case 240 : TimeFrameStr="Period_H4"; break;
case 1440 : TimeFrameStr="Period_D1"; break;
case 10080 : TimeFrameStr="Period_W1"; break;
case 43200 : TimeFrameStr="Period_MN1"; break;
default : TimeFrameStr="Current Timeframe";
}
//---- name for DataWindow and indicator subwindow label
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
//---- name for DataWindow and indicator subwindow label
short_name="WPR_Filter ("+PeriodeWPR+") "+TimeFrameStr;
IndicatorShortName(short_name);
if (TimeFrame < Period()) TimeFrame = Period();
return(0);
}
//+------------------------------------------------------------------+
//| ProSol Confirmation |
//+------------------------------------------------------------------+
int start()
{
int trend;
double PSC0;
datetime TimeArray[];
int shift,limit,y=0,counted_bars=IndicatorCounted();
// Plot defined time frame on to current time frame
ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame);
limit=Bars-counted_bars;
limit=MathMax(limit,TimeFrame/Period());
limit=MathMin(limit,MaxBarsToCount);
for(shift=0,y=0;shift<limit;shift++)
{
if (Time[shift]<TimeArray[y]) y++;
PSC0=iWPR(NULL, TimeFrame, PeriodeWPR, y);
if (PSC0>-50 && PSC0<OverBoughtLevel) trend=1;
if (PSC0>OverBoughtLevel) trend=2;
if (PSC0<-50 && PSC0>OverSoldLevel) trend=-1;
if (PSC0<=OverSoldLevel) trend=-2;
if (trend==1)
{
UpBuffer1[shift]=0;
UpBuffer2[shift]=1;
DnBuffer1[shift]=0;
DnBuffer2[shift]=0;
}
if (trend==2)
{
UpBuffer1[shift]=1;
UpBuffer2[shift]=0;
DnBuffer1[shift]=0;
DnBuffer2[shift]=0;
}
if (trend==-1)
{
UpBuffer1[shift]=0;
UpBuffer2[shift]=0;
DnBuffer1[shift]=0;
DnBuffer2[shift]=1;
}
if (trend==-2)
{
UpBuffer1[shift]=0;
UpBuffer2[shift]=0;
DnBuffer1[shift]=1;
DnBuffer2[shift]=0;
}
}
return(0);
}
Comments