MultiTrandOscilator2
Download scriptThe MultiTrandOscilator is a sophisticated technical analysis tool designed to provide traders with a multi-dimensional view of currency market trends. Rather than looking at a single pair in isolation, this indicator synthesizes data from multiple related currency pairs to create a more comprehensive picture of market momentum.
Core Logic and Functionality
The script operates by calculating the "spread" or difference between two specific Moving Averages (a fast-moving average and a slow-moving average) across five different data streams. By comparing these averages, the tool identifies how quickly price trends are moving relative to their historical norms.
Here is a breakdown of how the logic processes this information:
1. Primary Data Collection The indicator monitors the price action of several key currency pairs simultaneously (specifically focusing on EUR, USD, JPY, and CHF). It calculates individual momentum values for:
- EUR/USD
- EUR/JPY
- USD/JPY
- EUR/CHF
- USD/CHF
2. Relationship Synthesis The true power of this script lies in how it combines these individual pairs into "composite" trends. Instead of just showing you five separate lines, it performs mathematical operations to show you how different markets interact:
- Relative Differences: It calculates the difference between certain pairs (e.g., comparing the movements of EUR/JPY and USD/JPY) and scales them to ensure they can be viewed on the same chart.
- Averages and Blends: It creates new, synthesized data points by averaging these differences. This helps a trader see the "collective" sentiment of a currency group (like the Euro or the Yen) across different types of markets (like the Japanese market vs. the Swiss market).
3. Visual Output The results are displayed in a separate window as a series of histograms. These represent:
- The raw momentum of the primary pair.
- The relative strength between specific currency interactions.
- Combined "hybrid" oscillators that blend multiple market influences into a single visual signal.
Summary for the Trader
In plain terms, this tool acts like a "composite" indicator. If you are trading a specific currency, it looks at its neighbors and related markets to tell you if the trend is being supported by the broader market or if it is an isolated movement. It seeks to filter out "noise" by blending multiple signals into smoother, more reliable visual trends.
//+------------------------------------------------------------------+
//| MultiTrandOscilator.mq4 |
//| Copyright © 2008, XrustSoftware |
//| http://www.xrust.ucoz.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, XrustSoftware"
#property link "http://www.xrust.ucoz.net"
#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Lime
#property indicator_color2 Blue
#property indicator_color3 Green
#property indicator_color4 Black
#property indicator_color5 Red
//---- input parameters
extern int MaFast=169;
extern int MaSlow=313;
extern int LineWidth=2;
extern int ModeMain=0;
extern int ModeSignal=0;
extern int PriseMain=0;
extern int PriseSignal=0;
extern bool EURUSDJPY=false;
extern bool EURUSDCHF=false;
extern bool CHFJPY=true;
extern bool EURCHFJPY=false;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
if(EURUSDJPY){int a=0;}else{a=12;}
if(EURUSDCHF){int b=0;}else{b=12;}
if(CHFJPY) {int c=0;}else{c=12;}
if(EURCHFJPY){int d=0;}else{d=12;}
//---- indicators
SetIndexStyle(0,DRAW_HISTOGRAM,EMPTY,LineWidth);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,a,EMPTY,LineWidth);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,b,EMPTY,LineWidth);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle(3,c,EMPTY,LineWidth);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexStyle(4,d,EMPTY,LineWidth);
SetIndexBuffer(4,ExtMapBuffer5);
IndicatorShortName("MultiTrandOscilator "+MaFast+" "+MaSlow+" ");
SetIndexLabel(0,"EURUSD");
SetIndexLabel(1,"EUR\JPY/USD\JPY");
SetIndexLabel(2,"EUR\CHF/USD\CHF");
SetIndexLabel(3,"(EUR\JPY/USD\JPY+EUR\CHF/USD\CHF)/2");
SetIndexLabel(4,"EURUSD+(EUR\JPY/USD\JPY+EUR\CHF/USD\CHF)/3");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int counted_bars=IndicatorCounted();
//----
if(counted_bars>0)
counted_bars--;
for (int i=0;i<1000;i++)//Çàãîíÿåì òåêóùèå çíà÷åíèÿ ÌÀøåê â ìàññèâ
{
double a = iMA("EURUSD",0,MaFast,0,ModeMain,PriseMain,i)-iMA("EURUSD",0,MaSlow,0,ModeMain,PriseMain,i);
double b = iMA("EURJPY",0,MaFast,0,ModeSignal,PriseSignal,i)-iMA("EURJPY",0,MaSlow,0,ModeSignal,PriseSignal,i);
double c = iMA("USDJPY",0,MaFast,0,ModeSignal,PriseSignal,i)-iMA("USDJPY",0,MaSlow,0,ModeSignal,PriseSignal,i);
double d = iMA("EURCHF",0,MaFast,0,ModeSignal,PriseSignal,i)-iMA("EURCHF",0,MaSlow,0,ModeSignal,PriseSignal,i);
double e = iMA("USDCHF",0,MaFast,0,ModeSignal,PriseSignal,i)-iMA("USDCHF",0,MaSlow,0,ModeSignal,PriseSignal,i);
ExtMapBuffer1[i]=a;
ExtMapBuffer2[i]=(b-c)/100;
ExtMapBuffer3[i]=d-e;
ExtMapBuffer4[i]=(d-e)+((b-c)/100)/2;
ExtMapBuffer5[i]= (a+((b-c)/100)+(d-e))/3;
Comment(a+"\n"+b+"\n"+c+"\n"+d+"\n"+e);
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments