Author: Copyright � 2007, MetaQuotes Software Corp.
BSI

This tool is designed to analyze market sentiment by monitoring the relative strength of three specific currency pairs: GBP/USD, EUR/USD, and USD/CHF. By observing how these three pairs move in relation to one another, the script attempts to identify broad "Buy" or "Sell" signals based on their collective momentum.

How it Works

The logic operates by pulling data from a separate technical indicator (RSX) for each of the three currency pairs simultaneously. It then evaluates the numerical value of these indicators against a central baseline of 50.

The core decision-making process follows these steps:

  • Individual Analysis: The script checks whether the strength of the GBP/USD, EUR/USD, and USD/CHF pairs is currently above or below the 50 mark.
  • Score Calculation: It assigns a specific value to each pair based on its position relative to that 50 mark. If a pair is performing strongly (above 50), it contributes a positive point; if it is performing weakly (below 50), it contributes a negative point.
  • Trend Confirmation: The script adds these scores together to determine a "Total Trigger" value. It looks for high-confidence agreement between the three pairs:
    • Buy Signal: If the combined score shows strong positive movement (specifically if the calculation exceeds a threshold of 2), the tool highlights a "BUY" signal on your chart.
    • Sell Signal: If the combined score shows strong negative movement (specifically if the calculation drops below -2), the tool highlights a "SELL" signal on your chart.
    • Neutral State: If the movements of the three pairs are mixed or inconsistent, no signal is displayed, indicating that there is no clear trend in the data.

Summary for Traders

Essentially, this script acts as a filter to help you see when multiple major currency pairs are moving in harmony. Instead of looking at just one chart, it synthesizes the momentum of three different markets to tell you when there is a high probability of a collective move in a specific direction, helping to filter out "noisy" price action where different currencies might be moving against each other.

Miscellaneous
Implements a curve of type %1
18 Views
0 Downloads
0 Favorites
BSI
//+------------------------------------------------------------------+
//|                                                          BSI.mq4 |
//|                      Copyright © 2007, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Yellow
#property indicator_color2 Lime
#property indicator_color3 DeepPink
#property indicator_color4 Blue
#property indicator_width4 5
#property indicator_color5 Red
#property indicator_width5 5
#property indicator_level1 50

//---- buffers
double BUY[];
double SELL[];
double GBPUSD[];
double EURUSD[];
double USDCHF[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,GBPUSD);

   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,EURUSD);

   SetIndexStyle(2,DRAW_LINE);
   SetIndexBuffer(2,USDCHF);

   SetIndexStyle(3,DRAW_LINE);
   SetIndexBuffer(3,BUY);

   SetIndexStyle(4,DRAW_LINE);
   SetIndexBuffer(4,SELL);

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    i, j, counted_bars=IndicatorCounted();
//----
   i=Bars-counted_bars;
   while(i>=0)
   {
     GBPUSD[i]=iCustom("GBPUSD",0,"RSX",3,0,i);
     EURUSD[i]=iCustom("EURUSD",0,"RSX",3,0,i);
     USDCHF[i]=iCustom("USDCHF",0,"RSX",3,0,i);
     int GU_Trig=1,EU_Trig=1,UC_Trig=1,vTrig;
     if(GBPUSD[i]<50)GU_Trig=-1;
     if(EURUSD[i]<50)EU_Trig=-1;
     if(USDCHF[i]<50)UC_Trig=-1;
     vTrig=GU_Trig+EU_Trig-UC_Trig;
     if(vTrig>2)
     {
       BUY[i]=50;
       SELL[i]=EMPTY_VALUE;
     } else 
     if(vTrig<-2)
     {
       BUY[i]=EMPTY_VALUE;
       SELL[i]=50;
     }
     else 
     {
       BUY[i]=EMPTY_VALUE;
       SELL[i]=EMPTY_VALUE;
     }
     i--;
   }
   
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments