3perekosa
Download scriptThis tool is designed as a specialized visual aid for currency traders who want to identify specific market relationships by analyzing three different currency pairs simultaneously. Instead of looking at prices in isolation, the script calculates the mathematical relationship between them to reveal underlying trends that might not be visible on a standard price chart.
How the Logic Works
The core functionality of this indicator revolves around "Cross-Pair Analysis." It takes three specific currencies—two primary pairs and one cross pair—and processes their current market prices through three distinct mathematical lenses:
1. Combined Correlation (The First Line) The first calculation determines the combined weight of the two main currency pairs relative to the cross pair. By multiplying the values of the primary pairs and comparing them against the cross pair, it helps traders visualize if the combined strength of those two currencies is moving in harmony with or away from the third.
2. Relative Difference (The Second Line) The second calculation looks at the direct gap between the first main currency pair and the cross pair, adjusted by the value of the second main pair. This identifies how much "pull" the first currency has over the others in a balanced environment.
3. Inverse Influence (The Third Line) The third calculation mirrors the previous one but swaps the positions of the main pairs. It looks at the gap between the second main currency pair and the cross pair, adjusted by the first. This allows you to see if the secondary currency is exerting more influence on the cross pair than its counterpart.
What This Means for the Trader
Rather than just showing you a "price," this indicator provides a three-line visual map in a separate window:
- Trend Identification: When the lines move in the same direction, it indicates a synchronized movement across all three currency relationships.
- Divergence Detection: If one line moves upward while the others move downward or remain flat, it highlights a specific imbalance. This suggests that one of your primary currencies is behaving differently than the group, which could signal a potential shift in the market trend.
- Comparative Analysis: By viewing all three calculations at once, you can quickly see which currency pair is the "driver" of the current movement and which one is lagging behind.
In short, this script simplifies complex multi-currency correlations into a clear visual representation, helping you see the "big picture" of how these specific currencies are interacting with one another in real-time.
//+------------------------------------------------------------------+
//| 3perekosa.mq4 |
//+------------------------------------------------------------------+
#property copyright "Ïîðó÷èê & aka KimIV"
#property link "http://www.kimiv.ru"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Aqua
#property indicator_color2 Blue
#property indicator_color3 Red
//------- Ãëîáàëüíûå ïåðåìåííûå --------------------------------------
//------- Âíåøíèå ïàðàìåòðû èíäèêàòîðà -------------------------------
extern string NameCross = "GBPCHF"; // Íàèìåíîâàíèå êðîññà
extern string NameMain1 = "GBPUSD"; // Íàèìåíîâàíèå îñíîâíîé ïàðû 1
extern string NameMain2 = "USDCHF"; // Íàèìåíîâàíèå îñíîâíîé ïàðû 2
//------- Áóôåðû èíäèêàòîðà ------------------------------------------
double buf0[], buf1[], buf2[];
double P1=0,P2=0,P3=0;
//+------------------------------------------------------------------+
//| 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);
SetIndexStyle (1, DRAW_LINE, STYLE_SOLID, 2);
SetIndexEmptyValue(1, 0);
SetIndexBuffer(2, buf2);
SetIndexLabel (2, NameMain2);
SetIndexStyle (2, DRAW_LINE, STYLE_SOLID, 2);
SetIndexEmptyValue(2, 0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
void deinit() {
Comment("");
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
void start() {
P1=MarketInfo(NameMain1, MODE_BID)*MarketInfo(NameMain2, MODE_BID)-MarketInfo(NameCross, MODE_BID);
P2=MarketInfo(NameMain1, MODE_BID)-MarketInfo(NameCross, MODE_BID)/MarketInfo(NameMain2, MODE_BID);
P3=MarketInfo(NameMain2, MODE_BID)-MarketInfo(NameCross, MODE_BID)/MarketInfo(NameMain1, MODE_BID);
buf0[0]=P1;
buf1[0]=P2;
buf2[0]=P3;
}
//+------------------------------------------------------------------+
Comments