PhilNelSignals

Download script
PhilNelSignals

This trading tool is designed as a visual signaling system for the MetaTrader 4 platform, specifically optimized for high-frequency environments like the 5-minute chart. Its primary objective is to identify specific momentum shifts by analyzing the relationship between three different moving averages and the current price angle.

Core Analytical Logic

The script monitors three distinct types of moving averages simultaneously:

  • Short-term EMA (Exponential Moving Average): Tracks immediate price action.
  • Medium-term EMA: Identifies the intermediate trend.
  • Long-term SMA (Simple Moving Average): Establishes the broader market direction.

By comparing these three layers, the system ensures that it only looks for signals when there is a clear, structured alignment in the market's momentum.

Buy and Sell Criteria

The tool generates visual signals (arrows) based on two specific sets of conditions:

1. Buy Signals (Upward Momentum): For an upward signal to appear, the following must happen simultaneously:

  • Trend Alignment: The short-term average must be above the medium-term, and the medium-term must be above the long-term average.
  • Angle Confirmation: A custom angle calculation must indicate a positive upward slope.
  • Price Positioning: The price (either the opening or closing price of the current candle) must be positioned specifically between the short-term and medium-term averages.

2. Sell Signals (Downward Momentum): For a downward signal to appear, the following must happen simultaneously:

  • Trend Alignment: The short-term average must be below the medium-term, and the medium-term must be below the long-term average.
  • Angle Confirmation: The custom angle calculation must indicate a negative downward slope.
  • Price Positioning: The price (either the opening or closing price of the current candle) must be positioned specifically between the short-term and medium-term averages.

User Notifications

Beyond providing visual arrows on the chart, the script includes an automated alert system. When the specific criteria for a Buy or Sell signal are met on a new bar of data, the system will trigger a pop-up notification on your trading platform. This ensures that traders can react quickly to potential opportunities without needing to constantly watch the screen.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
11 Views
0 Downloads
0 Favorites
PhilNelSignals
//+---------------------------------------------------------+
//| Phil_Nell_Signals.mq4                                   |
//| This is a 5 min. system                                 |
//+---------------------------------------------------------+

#property  copyright "Copyright © 2007, Dariuske"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 LimeGreen
#property indicator_width1 2
#property indicator_color2 OrangeRed
#property indicator_width2 2

//---- input parameters

extern int SMAPeriod = 50;
extern double Angle = 0.25;
extern int CountBars=500;
extern bool UseAlert=True;

//---- buffers
double CrossUp[];
double CrossDown[];
double prevtime;

double val1[];
double val2[];
int Timer;
string UD="";
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- indicator line
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_ARROW);
   SetIndexArrow(0,108);
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexArrow(1,108);
   SetIndexBuffer(0,val1);
   SetIndexBuffer(1,val2);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| AltrTrend_Signal_v2_2                                            |
//+------------------------------------------------------------------+
int start()
  {   
  int i,shift,counted_bars=IndicatorCounted();
   
   int limit, j, counter;
   double shortMA, medMA, longMA, fAngle;
   
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;

   limit=Bars-counted_bars;

for ( shift = CountBars; shift>=0; shift--) 
{ 
      shortMA = iMA(NULL, 0, 10, 0, MODE_EMA, PRICE_CLOSE, shift);
      medMA = iMA(NULL, 0, 21, 0, MODE_EMA, PRICE_CLOSE, shift);
      longMA = iMA(NULL, 0, 50, 0, MODE_SMA, PRICE_CLOSE, shift);
      fAngle = iCustom(NULL, 0, "SMAAngle", SMAPeriod, 0.15, 2, 0, 0, shift);
      
 	   val1[shift]=0;
		val2[shift]=0;

if  ((fAngle <= -Angle) && (shortMA < medMA) && (medMA < longMA) && 
     (((Close[shift] > shortMA) && (Close[shift] < medMA) ) ||
      ((Open[shift] > shortMA) && (Open[shift] < medMA) )) 
     )
     
{
	val2[shift]=High[shift]+6*Point;
	if (shift < 2 )
	
	{
	   UD="DOWN.";
		DoAlert(UD);
	}

}
 if ((fAngle >= Angle) && (shortMA>medMA) && (medMA > longMA) && 
      (((Close[shift] < shortMA) && (Close[shift] > medMA) ) ||
      ((Open[shift] < shortMA) && (Open[shift] > medMA) ))
     )

{
		val1[shift]=Low[shift]-6*Point;
	
	 if (shift < 2 )
  { 
  UD=" UP.";	
  DoAlert(UD);
  }
}

}
   //return(0);
  }
 
void DoAlert(string UD)
{
   if (!NewBar() || !UseAlert)
      return;
     Alert (Symbol()," ",Period()," Phil Nel Signals",UD);

}


  bool NewBar()
{
   static datetime dt  = 0;
   if (dt != Time[0])
   {
      dt = Time[0];
      return(true);
   }
  
}

//+------------------------------------------------------------------+

Comments