MrsPacManSignal4
Download scriptThe MrsPacMan Signal is a specialized trading tool designed to identify high-probability momentum shifts by analyzing a combination of price trends, volume activity, and market velocity. Rather than relying on a single piece of data, this script evaluates several different mathematical layers simultaneously to filter out "noise" and confirm strong moves in the market.
How the Logic Works
The script functions by constantly monitoring five primary metrics:
1. Volume Confirmation Before looking at price movement, the script checks for market participation. It compares current trading volume against a specific moving average. This ensures that any signal generated is backed by significant trading activity, helping to filter out low-interest movements where the price might be drifting without real momentum.
2. Multi-Layered Moving Averages The core of the logic involves comparing different types of "Moving Averages." These are tools that smooth out price fluctuations to show the underlying trend. The script tracks three distinct types:
- Fast Momentum: Short-term averages (6 and 5 periods) that react quickly to immediate price changes.
- Medium Trend: A standard smoothing average (12 periods).
- Long-Term Trend: A more gradual average (21 periods) that represents the broader market direction.
By comparing these against one another, the script ensures that the short-term momentum is perfectly aligned with the medium and long-term trends.
3. Directional Velocity (The "Shift") The script doesn't just look at where the price is; it looks at where it is going. It compares the current fast momentum against its previous state. This allows the tool to detect the exact moment a trend begins to accelerate upward or downward.
4. Market Velocity (CCI) Finally, the script utilizes a "Commodity Channel Index" (CCI). In this context, it acts as a boundary check. It looks for "oversold" or "overbought" conditions to ensure that the trade isn't being taken at an exhausted point in the market.
Signal Generation
The script produces two primary alerts based on specific "confluences"—situations where all the above conditions align perfectly:
-
Buy Signal (Bullish): Triggered when there is high volume, and the short-term momentum is actively breaking above the medium and long-term trends in an upward direction, while the market velocity remains within a favorable lower boundary.
-
Sell Signal (Bearish): Triggered when there is high volume, and the short-term momentum is breaking below the medium and long-term trends in a downward direction, while the market velocity remains within a favorable upper boundary.
Summary for the User
In simple terms, this script acts as a trend-alignment filter. It waits for a moment where "the big players" are active (Volume), the short-term trend is aggressively moving in one direction (Moving Averages), and the market hasn't yet reached an exhausted state (CCI). When all these conditions meet at once, it alerts you to a potential high-momentum entry.
//+------------------------------------------------------------------+
//| MrsPacManSignal4.mq4 |
//| xxDavidxSxx |
//| xxDavidxSxx@yahoo.com |
//+------------------------------------------------------------------+
#property copyright "xxDavidxSxx"
#property link "xxDavidxSxx@yahoo.com"
#property indicator_separate_window
#property indicator_buffers 7
#property indicator_color1 Red
#property indicator_color2 MediumPurple
#property indicator_color3 Aqua
#property indicator_color4 MintCream
#property indicator_color5 Orange
#property indicator_color6 Blue
#property indicator_color7 Silver
extern int CCI_PeroidFast=55;
extern int MA_Volume=100;
extern int L_cciblock=250;
extern int S_cciblock=-250;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
double ExtMapBuffer7[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexStyle(4,DRAW_LINE);
SetIndexBuffer(4,ExtMapBuffer5);
SetIndexStyle(5,DRAW_LINE);
SetIndexBuffer(5,ExtMapBuffer6);
SetIndexStyle(6,DRAW_LINE);
SetIndexBuffer(6,ExtMapBuffer7);
IndicatorShortName("MrsPacMan Signal");
//---- initialization done
double ma1prev=0,cci1=0,ma=0,ma1=0,ma2=0,ma3=0,jmav=0;
ma=iMA(NULL,0,6,0,MODE_LWMA,PRICE_WEIGHTED,1);
ma1=iMA(NULL,0,5,0,MODE_LWMA,PRICE_WEIGHTED,1);
ma1prev=iMA(NULL,0,5,0,MODE_LWMA,PRICE_WEIGHTED,2);
ma2=iMA(NULL,0,12,0,MODE_SMMA,PRICE_WEIGHTED,1);
ma3=iMA(NULL,0,21,0,MODE_EMA,PRICE_TYPICAL,1);
jmav=iCustom(Symbol(),Period(),"volumeMA",0,1);
cci1=iCCI( NULL, 0, CCI_PeroidFast, PRICE_TYPICAL, 1);
//Long
if (jmav > MA_Volume && ma1 > ma1prev && ma1 > ma && ma1 > ma2 && ma2 > ma3 && ma1 > ma3 && cci1< L_cciblock )
{
Alert ("MrsPacMan Buy Signal Generated",SYMBOL_ARROWUP);
}//Short
if (jmav > MA_Volume && ma1 < ma1prev && ma1 < ma && ma1 < ma2 && ma2 < ma3 && ma1 < ma3 && cci1 > S_cciblock )
{
Alert ("MrsPacMan Sell Signal Generated",SYMBOL_ARROWDOWN);
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
//----
return(0);
}
//+------------------------------------------------------------------+
Comments