Arbitraz
Download scriptThis tool is designed to provide a visual representation of a specific synthetic market relationship directly on your trading chart. Instead of looking at just one currency pair in isolation, this script calculates and draws a unique data point based on the interaction between two different markets simultaneously.
How the Logic Works
The core purpose of this script is to multiply the closing values of two specific currency pairs: GBP/USD and EUR/GBP. By combining these two assets into a single calculation, the indicator creates a customized value that reflects the combined movement of these currencies.
Here is a breakdown of how the logic processes this information:
- Historical Data Processing: The script scans through the entire historical price history available on your chart. For every past candle, it looks at the "Closing Price" of both GBP/USD and EUR/GBP and multiplies them together.
- Visual Mapping: It takes these calculated results and maps them onto a continuous red line. This allows you to see how this combined mathematical relationship has behaved over time.
- Real-Time Updates: To ensure the information stays current, the script performs a final calculation for the very latest moment in the market. It captures the most recent "Bid" prices (the current卖 offer price) for both pairs, multiplies them, and updates the tip of the line to reflect the live market status.
The End Result
By using this logic, you are not looking at a standard price; you are viewing a custom-weighted calculation. It allows you to observe the combined momentum of the British Pound against both the US Dollar and the Euro in one unified visual element on your screen.
#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