i-Cross%26Main_m

Download script
Author: ������� & aka KimIV
i-Cross%26Main_m

This tool is designed to provide traders with a visual comparison between different currency movements simultaneously on a single chart. Rather than looking at multiple windows, it allows you to observe the relationship between a "Cross Pair" and a mathematical combination of two other "Main Pairs."

How the Logic Works

The script focuses on three specific currency pairs that you define in the settings:

  1. The Cross Pair: The tool tracks the live price of a primary currency pair (for example, GBP/CHF). This is displayed as one distinct line on your chart.
  2. The Main Pairs Product: Simultaneously, the tool takes two other independent currency pairs and multiplies their current prices together. For instance, if you choose GBP/USD and USD/CHF, the script calculates their combined value in real-time.
  3. Visual Correlation: By plotting both of these values on the same graph, the tool allows you to see how closely they move in sync.

Key Objectives for the User

  • Relationship Tracking: The primary goal is to identify correlations. If the line representing the "Cross Pair" moves in the same direction and at the same speed as the "Main Pairs Product" line, it suggests a strong underlying connection between those currencies.
  • Diversification Analysis: It helps traders understand how different currency components (like the British Pound or the Swiss Franc) are affecting different pairs across the market.
  • Customizable Scope: You can choose exactly how much historical data you want to view on the chart at one time, ensuring the display remains clean and relevant to your current trading timeframe.

In essence, this script simplifies complex multi-pair analysis by distilling the relationship between three currency pairs into two easily comparable visual lines.

9 Views
0 Downloads
0 Favorites
i-Cross%26Main_m
//+------------------------------------------------------------------+
//|                                                 i-Cross&Main.mq4 |
//|                                              Ïîðó÷èê & aka KimIV |
//|                                              http://www.kimiv.ru |
//|                                                                  |
//|  07.01.2006  Èíäèêàòîð êðîññà è ïðîèçâåäåíèÿ îñíîâíûõ ïàð.       |
//+------------------------------------------------------------------+
#property copyright "Ïîðó÷èê & aka KimIV"
#property link      "http://www.kimiv.ru"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Aqua
#property indicator_color2 Blue

//------- Ãëîáàëüíûå ïåðåìåííûå --------------------------------------

//------- Âíåøíèå ïàðàìåòðû èíäèêàòîðà -------------------------------
extern string NameCross    = "GBPCHF"; // Íàèìåíîâàíèå êðîññà
extern string NameMain1    = "GBPUSD"; // Íàèìåíîâàíèå îñíîâíîé ïàðû 1
extern string NameMain2    = "USDCHF"; // Íàèìåíîâàíèå îñíîâíîé ïàðû 2
extern int    NumberOfBars = 1000;     // Êîëè÷åñòâî áàðîâ îáñ÷¸òà (0-âñå)

//------- Áóôåðû èíäèêàòîðà ------------------------------------------
double buf0[], buf1[];
double max=-999, min=999;

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void init() {
  SetIndexBuffer(0, buf0);
  SetIndexLabel (0, NameCross);
  SetIndexStyle (0, DRAW_LINE, STYLE_SOLID, 2);
  SetIndexEmptyValue(0, 0);

  SetIndexBuffer(1, buf1);
  SetIndexLabel (1, NameMain1+"*"+NameMain2);
  SetIndexStyle (1, DRAW_LINE, STYLE_SOLID, 2);
  SetIndexEmptyValue(1, 0);
}

//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
void deinit() {
  Comment("");
}

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
void start() {
  int LoopBegin, sh;

      if (NumberOfBars==0) LoopBegin=Bars-1;
  else LoopBegin=NumberOfBars-1;
  LoopBegin=MathMin(Bars-1, LoopBegin);

  for (sh=LoopBegin; sh>=0; sh--) {
    buf0[sh]=MarketInfo(NameCross, MODE_BID);
    buf1[sh]=MarketInfo(NameMain1, MODE_BID)*MarketInfo(NameMain2, MODE_BID);
//    if buf0[sh]-buf1[sh]
  }
}
//+------------------------------------------------------------------+

Comments