This tool is designed to identify specific market momentum shifts by monitoring two different currency pairs simultaneously. Rather than looking at a single chart in isolation, it analyzes the relationship between EUR/USD and EUR/JPY to provide visual signals on your main trading screen.
How the Logic Works
The script operates by scanning historical price data (up to 3,500 bars) and calculating specific momentum values for both currency pairs using a specialized calculation method. It looks for "confluence," which means it only triggers a signal when both currency pairs agree on a market direction at the same time.
1. Tracking the Pairs The system simultaneously tracks two different data feeds:
- The EUR/USD pair.
- The EUR/JPY pair.
2. Identifying Upward Momentum (Buy Signals) The script looks for a specific "positive" condition in both pairs. If the momentum values for both EUR/USD and EUR/JPY meet a predetermined positive threshold simultaneously, the tool identifies this as a shared bullish sentiment. When this happens, it places a visual marker (an arrow) above the high of the current candle.
3. Identifying Downward Momentum (Sell Signals) Similarly, the script monitors for "negative" conditions. If both currency pairs show a significant drop in momentum at the same time (falling below a specific negative threshold), the tool identifies this as a shared bearish sentiment. When this occurs, it places a visual marker (an arrow) below the low of the current candle.
Summary for the Trader
Essentially, this script acts as a filter. Instead of showing you every minor price movement, it waits for a "double confirmation." It only alerts you when both the EUR/USD and EUR/JPY markets show synchronized momentum, helping to highlight moments where there is stronger agreement across different currency movements.
//+------------------------------------------------------------------+
//| WPR E-J.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("EURJPY",15,"WPRfast",P,n1,n2,3000,0,i);
F_d_GBP=iCustom("EURJPY",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