Arbitraz_v1

Download script
Arbitraz_v1

This tool is designed to visualize a specific relationship between two different currency pairs simultaneously on a single chart. Instead of looking at just one market, it creates a custom data point by combining the values of others.

How the Logic Works

1. Data Combination (Cross-Product Calculation) The core logic of this script involves taking the closing prices of two distinct assets—specifically GBPUSD and EURGBP—and multiplying them together. By performing this calculation, the tool generates a unique "hybrid" value that represents the mathematical interaction between these two pairs.

2. Historical Data Mapping The script scans through your entire trading history (the "bars" on your chart). For every point in the past, it identifies what the closing price was for both GBPUSD and EURGBP at that exact moment, multiplies them, and plots that result as a continuous line. This allows you to see how this specific combined value has fluctuated over time.

3. Real-Time Price Tracking In addition to the historical data, the script constantly monitors the live market. It looks at the current "Bid" price (the current selling price) for both currency pairs and updates the very last point on the chart instantly. This ensures that as the market moves in real-time, the final point of the line reflects the most up-to-date combined value.

Visual Output

The result is a red line displayed directly on your trading window. Rather than showing you the standard price of a single currency, this line represents the "Product" of the two chosen pairs. Traders use this type of logic to identify unique patterns or trends that might not be visible when looking at either currency pair in isolation.

Price Data Components
Series array that contains close prices for each bar
Miscellaneous
Implements a curve of type %1
9 Views
0 Downloads
0 Favorites
Arbitraz_v1
//+------------------------------------------------------------------+
//|                                                                  |
//|                 Copyright © 2000-2007, MetaQuotes Software Corp. |
//|                                         http://www.metaquotes.ru |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_buffers  1
#property indicator_color1 Red
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   return(0);
  }
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int start()
  {
   int cnt;
     for(cnt=0;cnt<=iBars(NULL,0); cnt++) {
      ExtMapBuffer1[cnt]=iClose( "GBPUSD", 0, cnt)*iClose( "EURGBP", 0, cnt);
     }//for 
   ExtMapBuffer1[0]=MarketInfo( "GBPUSD", MODE_BID)*MarketInfo( "EURGBP", MODE_BID);
   return(0);
  }
//+------------------------------------------------------------------+

Comments