This tool is designed to identify specific market signals by analyzing the relationship between two different currency pairs simultaneously. Instead of looking at just one chart, it gathers data from multiple sources to confirm a trend before providing a visual cue to the trader.
How the Logic Works
1. Multi-Pair Correlation The core logic of this script relies on monitoring two specific currency pairs: EURJPY and GBPJPY. Rather than making a decision based on just one pair, the script looks for "agreement" between both. It treats these two assets as a combined signal to increase the reliability of the data being presented.
2. Specialized Indicator Analysis The script pulls data from a secondary technical indicator (a variation of the Williams Price Range or "WPR"). It specifically tracks two different types of readings for each currency pair:
- A "fast" primary signal.
- A "slow" secondary signal.
By examining these readings across both EURJPY and GBPJPY, the script filters out minor market noise that might affect only one currency at a time.
3. Signal Confirmation Criteria The script looks for two distinct scenarios to trigger its visual markers:
- Upward Momentum: If the primary signals for both the EURJPY and GBPJPY pairs reach a specific positive threshold, the script identifies this as a collective upward movement. When this happens, it places a visual marker above the current price candle.
- Downward Momentum: Conversely, if the secondary signals for both currency pairs drop below a specific negative threshold, the script recognizes a collective downward trend. In this case, it places a visual marker below the current price candle.
4. Visual Output The final result for the user is a streamlined set of arrows on the chart. Because the logic requires both currency pairs to meet their respective criteria at the same time, these markers are intended to highlight moments where there is strong, synchronized momentum across the Japanese Yen trading pairs.
//+------------------------------------------------------------------+
//| WPR J-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("EURJPY",15,"WPRfast",P,n1,n2,3000,0,i);
F_d_EUR=iCustom("EURJPY",15,"WPRfast",P,n1,n2,3000,1,i);
F_u_GBP=iCustom("GBPJPY",15,"WPRfast",P,n1,n2,3000,0,i);
F_d_GBP=iCustom("GBPJPY",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