synchronize

Download script
Author: Senlin Ge 20081013
synchronize

This tool is designed to analyze the relationship and movement patterns between three different currency pairs simultaneously. By observing how these markets interact with one another, the script helps traders identify synchronization trends that might not be obvious when looking at a single chart in isolation.

Core Functionality

The logic operates by tracking the price changes of three specific assets—specifically configured for GBPJPY, EURJPY, and USDJPY—over a set period of historical data. Instead of just showing you the current price, the tool calculates the "movement" or the difference in closing prices from one candle to the next.

How the Analysis Works

The script processes the data in two primary stages:

  1. Price Change Tracking: It first measures the immediate price fluctuation for each of the three currency pairs. This captures whether the market moved up or down during each specific interval.
  2. Smoothing the Data: Raw price movements can often be "noisy" or erratic, making it difficult to see a clear trend. To solve this, the script applies a Linear Weighted Moving Average (LWMA) to those fluctuations. This smoothing technique gives more importance to recent price changes while filtering out minor market "jitters," resulting in a much cleaner visual representation of the trend.

Visual Representation

The output is displayed in a separate window on your platform, providing a multi-layered view of the three markets:

  • Visual Trend Lines: It generates distinct colored lines for each currency pair, allowing you to see at a glance if the assets are moving in harmony (synchronization) or moving in opposite directions.
  • Comparative Overlay: By placing all three smoothed trends in one window, the script makes it easy to identify "confluence"—points where multiple currencies react to market news or economic shifts at the same time.

Summary for Traders

Essentially, this tool acts as a synchronization monitor. It strips away the distractions of standard price charts and provides a smoothed, comparative look at how three major currency pairs behave relative to one another. This allows you to better understand the broader market sentiment and identify high-probability trends where multiple assets are moving in unison.

Price Data Components
Series array that contains close prices for each bar
Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
10 Views
0 Downloads
0 Favorites
synchronize
//+------------------------------------------------------------------+
//|                                                          |
//|                                                     |
//|                                             |
//+------------------------------------------------------------------+
#property copyright "Senlin Ge 20081013"
#property link      "http://new.qzone.qq.com/806935610"

#property indicator_separate_window
#property indicator_buffers 8
#property indicator_color1 Lime
#property indicator_color2 Red
#property indicator_color3 Yellow
#property indicator_color4 0Xff66ff
#property indicator_color5 0Xffcc00
#property indicator_color6 0X00cc00
//#property indicator_color2 Red
double buffer1[];
double buffer2[];
double buffer3[];
double buffer4[];
double buffer5[];
double buffer6[];
double BufferCorrel[];
extern int   barsToProcess=10000;
extern string symbol1="GBPJPY";
extern string symbol2="EURJPY";
extern string symbol3="USDJPY";
int timeframe=0;
string short_name;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
    //---- name for DataWindow and indicator subwindow label

   short_name="Synchronize("+symbol1+" ,"+symbol2+" ,"+symbol3+")"+" E_MAIL:yyy999@people.com.cn";
   IndicatorShortName(short_name);
  
//---- indicators
  SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1,Lime);
  SetIndexBuffer(0,buffer1);
  SetIndexStyle(1,DRAW_LINE,STYLE_SOLID,1,Red);
  SetIndexBuffer(1,buffer2);
  SetIndexStyle(2,DRAW_NONE,STYLE_SOLID,1,Yellow);
  SetIndexBuffer(2,buffer3);
  SetIndexStyle(3,DRAW_NONE,STYLE_SOLID,1,0Xff66ff);
  SetIndexBuffer(3,buffer4);
  SetIndexStyle(4,DRAW_NONE,STYLE_SOLID,1,0Xffcc00);
  SetIndexBuffer(4,buffer5);
  SetIndexStyle(5,DRAW_LINE,STYLE_SOLID,1,0Xccff00);
  SetIndexBuffer(5,buffer6);
  SetIndexStyle(6,DRAW_NONE,STYLE_SOLID,1,0X00cc00);
  SetIndexBuffer(6,BufferCorrel);
//----
   SetIndexLabel(2,symbol1);
   SetIndexLabel(3,symbol2);
   SetIndexLabel(4,symbol3);
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted(),
//----
   limit;
   int i=0; 
   if(counted_bars>0)
      counted_bars--;
   
   limit=Bars-counted_bars;
   
   if(limit>barsToProcess)
      limit=barsToProcess;

   while (i<limit)
   {
   
   //double k=(Open[i]-Close[i+1])/Point;
 //  if (k>0)
  //  buffer1[i]= k;
 //  if (k<0)
 //   buffer2[i]= k;
    //----------------------------------------------------------------
       buffer3[i]=iClose(symbol1,timeframe,i)-iClose(symbol1,timeframe,i+1);
       buffer4[i]=iClose(symbol2,timeframe,i)-iClose(symbol2,timeframe,i+1);
       buffer5[i]=iClose(symbol3,timeframe,i)-iClose(symbol3,timeframe,i+1);
       i++;
    
   }    
   //-------------------------------------------------------------------------
   i=0;
   while (i<limit)
   {
      //----------------------------------------------------------------
         buffer1[i]=iMAOnArray(buffer3,0,9,0,MODE_LWMA,i);
         buffer2[i]=iMAOnArray(buffer4,0,9,0,MODE_LWMA,i);
         buffer6[i]=iMAOnArray(buffer5,0,9,0,MODE_LWMA,i);
         i++;
    
   }    
//----
//----
   return(0);
  }
//+------------------------------------------------------------------+
//--------------------------------------------------------------------------------------------------------------`

Comments