CorrelationBurst
Download scriptThe CorrelationBurst indicator is designed to provide traders with a visual representation of how four major currency pairs move in relation to one another. By synchronizing these different markets into a single view, the tool allows users to identify shared momentum and potential "bursts" in market activity across multiple assets simultaneously.
Core Logic and Functionality
The script operates by analyzing the price movements of four specific currency pairs: GBPUSD, EURUSD, USDCHF, and USDJPY. Rather than looking at raw prices, which can vary wildly in scale, the indicator processes these currencies through a series of mathematical steps to make them comparable.
1. Momentum Calculation
For each of the four currency pairs, the script calculates a specific type of moving average (Linear Weighted Moving Average). It then measures the difference between the current value and the previous value. This effectively isolates the "velocity" or the immediate momentum of each currency pair, stripping away some of the background noise to show how fast the price is shifting in a specific direction.
2. Normalization and Scaling
Because different currencies have different values (for example, the exchange rate for the Japanese Yen is numerically different from that of the Euro), the script applies unique multipliers to each pair. This "levels the playing field" so that all four currencies can be plotted on the same visual scale. By normalizing these values, the indicator ensures that a significant move in one currency appears proportionally correct compared to a move in another.
3. Visual Correlation
The result is a multi-line graph where each line represents one of the four currencies. This allows you to see:
- Synchronized Movements: When lines move in the same direction at the same time, it indicates a high level of correlation.
- Divergences: When one line moves independently of the others, it highlights a unique market reaction for that specific currency.
- Relative Strength: It provides a clear picture of which currency pair is currently leading the "burst" in market activity.
Summary for Traders
Instead of monitoring four different charts to see how the global market is reacting, this indicator condenses that information into one window. It highlights the underlying trends and momentum across the Pound, Euro, Swiss Franc, and Yen, making it easier to spot coordinated market moves or identify outliers in currency performance.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| CorrelationBurst.mq4 |
//| Copyright © 2006, David W Honeywell 8/21/2006 |
//| DavidHoneywell800@msn.com transport.david@gmail.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, David W Honeywell 8/21/2006"
#property link "DavidHoneywell800@msn.com transport.david@gmail.com"
#property indicator_separate_window
#property indicator_level1 0.0000
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 White
#property indicator_color3 DodgerBlue
#property indicator_color4 Aqua
extern int periods = 17;
double Pound[];
double Euro[];
double Swisse[];
double Yen[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,Pound);
SetIndexLabel(0,"Val_0_Pound");
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,Euro);
SetIndexLabel(1,"Val_1_Euro");
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,Swisse);
SetIndexLabel(2,"Val_2_Swisse");
SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,Yen);
SetIndexLabel(3,"Val_3_Yen");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
int i;
//----
for (i=Bars-50; i>=0; i--)
{
double gbp = (iMA("GBPUSD",0,periods,0,MODE_LWMA,PRICE_WEIGHTED,i)-iMA("GBPUSD",0,periods,0,MODE_LWMA,PRICE_WEIGHTED,i+1));
double eur = (iMA("EURUSD",0,periods,0,MODE_LWMA,PRICE_WEIGHTED,i)-iMA("EURUSD",0,periods,0,MODE_LWMA,PRICE_WEIGHTED,i+1));
double chf = (iMA("USDCHF",0,periods,0,MODE_LWMA,PRICE_WEIGHTED,i)-iMA("USDCHF",0,periods,0,MODE_LWMA,PRICE_WEIGHTED,i+1));
double jpy = ((iMA("USDJPY",0,periods,0,MODE_LWMA,PRICE_WEIGHTED,i)-iMA("USDJPY",0,periods,0,MODE_LWMA,PRICE_WEIGHTED,i+1))*2);
Pound[i] = gbp*1000;
Euro[i] = eur*1000;
Swisse[i] = chf*1000;
Yen[i] = jpy*10;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments