Author: Copyright � 2009, MetaQuotes Software Corp.
WPR G-E

This script is designed as a visual trading tool for the MetaTrader 4 platform. Its primary purpose is to identify specific market conditions by analyzing the relationship between two major currency pairs—EURUSD and GBPUSD—to provide clear visual signals on your chart.

How the Logic Works

The script functions by monitoring "momentum" data from both the EURUSD and GBPUSD charts simultaneously. Instead of looking at price movements in isolation, it seeks out moments where both currencies are exhibiting similar behavioral trends.

1. Data Gathering The tool looks back at a significant amount of historical market data (specifically over 3,500 bars). It pulls information from a secondary momentum indicator (WPRfast) for both the EURUSD and GBPUSD pairs. This allows the script to "see" how these two currencies are moving relative to their recent highs and lows.

2. Signal Identification The logic is divided into two specific scenarios:

  • Upward Momentum Signals: The script checks if the momentum data for both EURUSD and GBPUSD exceeds a certain positive threshold at the same time. If both pairs show synchronized bullish strength, the tool marks this point on your chart with an upward-facing arrow.
  • Downward Momentum Signals: Conversely, the script monitors if the momentum data for both currencies falls below a specific negative threshold simultaneously. When both pairs show synchronized bearish weakness, the tool marks this point with a downward-facing arrow.

3. Visual Representation Rather than cluttering your main price chart with complex numbers, the script converts these mathematical findings into simple visual markers:

  • Buy Signals: Placed slightly above the highest price of the candle when both pairs show positive momentum.
  • Sell Signals: Placed slightly below the lowest price of the candle when both pairs show negative momentum.

Summary for the User

In simple terms, this tool acts as a "confluence" filter. It only triggers a signal when both the Euro and the British Pound agree on a market direction. By requiring both currency pairs to align before showing a signal, the script aims to highlight stronger, more coordinated market moves while filtering out noise from individual currency fluctuations.

Miscellaneous
Implements a curve of type %1
14 Views
0 Downloads
0 Favorites
WPR G-E
//+------------------------------------------------------------------+
//|                                                         äâà1.mq4 |
//|                      Copyright © 2009, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 Blue

//---- input parameters
extern int P = 14;
extern int n1 = 14;
extern int n2 = 14;
extern int CountBars=3500;

//---- buffers
double val1[];
double val2[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- indicator line
   IndicatorBuffers(2);
   SetIndexStyle(0,DRAW_ARROW, EMPTY);
   SetIndexArrow(0,108);
   SetIndexBuffer(0,val1);
   SetIndexEmptyValue(0,0.0);
   SetIndexStyle(1,DRAW_ARROW, EMPTY);
   SetIndexArrow(1,108);
   SetIndexBuffer(1,val2);
   SetIndexEmptyValue(1,0.0);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| AltrTrend_Signal_v2_2                                            |
//+------------------------------------------------------------------+
int start()
  { double F_u_EUR,F_u_GBP,F_d_EUR,F_d_GBP;
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   for(int i=0; i<limit; i++)
{ 

	F_u_EUR=iCustom("EURUSD",15,"WPRfast",P,n1,n2,3000,0,i);
	F_d_EUR=iCustom("EURUSD",15,"WPRfast",P,n1,n2,3000,1,i);
	F_u_GBP=iCustom("GBPUSD",15,"WPRfast",P,n1,n2,3000,0,i);
	F_d_GBP=iCustom("GBPUSD",15,"WPRfast",P,n1,n2,3000,1,i);

if (F_u_EUR>0&&F_u_GBP>0)
{
	val1[i]=High[i]+35*Point;
}
if (0>F_d_EUR&&0>F_d_GBP) 
{
	val2[i]=Low[i]-35*Point;
}


}
   return(0);
  }
//+------------------------------------------------------------------+

Comments