RSI_SevenPairsSell

Author: Copyright � 2008, Robert Hill
RSI_SevenPairsSell

This script is designed as a multi-currency analysis tool for MetaTrader, specifically engineered to provide a high-level overview of market sentiment across several different currency pairs simultaneously. Instead of focusing on just one chart, it aggregates data from multiple markets to help identify broader trends.

Core Functionality

Multi-Pair Monitoring The tool is configured to track seven specific currency pairs at once (such as EURUSD, USDJPY, etc.). It automatically adjusts the naming conventions of these pairs to ensure they match the specific requirements of your trading platform's broker settings.

Momentum Analysis (RSI) For each of the selected currency pairs, the script calculates a Relative Strength Index (RSI). The RSI is a standard technical analysis tool used to measure the speed and change of price movements. By looking at these values, the script determines whether a specific currency pair is potentially overbought, oversold, or maintaining a steady trend.

Data Aggregation and Averaging The primary logic of this script lies in its "Average" calculation. Rather than showing you seven independent pieces of data that might conflict with one another, the script performs the following steps:

  1. It retrieves the RSI value for every active currency pair listed in your settings.
  2. It sums these individual values together.
  3. It divides that total by the number of pairs being tracked to create a single "Sell Average."

Visual Representation

The indicator displays these results in a separate window on your chart:

  • Individual Lines: You can view the specific RSI lines for each of the seven currency pairs, represented by red lines. This allows you to see how individual markets are behaving relative to one another.
  • The Average Line: A distinct yellow line represents the "Sell Average." This serves as a consolidated indicator of the collective momentum across all chosen pairs.

Summary for the Trader

The goal of this logic is to provide a "bird's eye view" of the market. By looking at the Yellow Average line alongside the individual red lines, you can quickly assess whether the majority of your selected currency pairs are moving in a similar direction or if there is significant divergence between them. It simplifies complex multi-market data into a single, digestible visual summary.

Indicators Used
Relative strength index
Miscellaneous
Implements a curve of type %1
11 Views
0 Downloads
0 Favorites
RSI_SevenPairsSell
//+---------------------------------------------------------------------+
//|                                    Copyright © 2008, Robert Hill    |
//+---------------------------------------------------------------------+
#property copyright "Copyright © 2008, Robert Hill"
#property link      ""
#property indicator_separate_window
#property indicator_buffers 8
#property indicator_color1 Red
#property indicator_color2 Red
#property indicator_color3 Red
#property indicator_color4 Red
#property indicator_color5 Red
#property indicator_color6 Red
#property indicator_color7 Red
#property indicator_color8 Yellow

extern string Sell_currency_pairs = "----- List of Sell currency pairs -----";
extern string mPair_1 = "EURUSD";
extern string mPair_2 = "USDJPY";
extern string mPair_3 = "AUDUSD";
extern string mPair_4 = "NZDJPY";
extern string mPair_5 = "GBPCHF";
extern string mPair_6 = "CHFJPY";
extern string mPair_7 = "EURCHF";

extern int RSI_Period = 14;
extern int BarsBack = 100;

string Pair1, Pair2, Pair3, Pair4, Pair5, Pair6, Pair7;
double Pair1_Buffer[];
double Pair2_Buffer[];
double Pair3_Buffer[];
double Pair4_Buffer[];
double Pair5_Buffer[];
double Pair6_Buffer[];
double Pair7_Buffer[];
double Avg_Buffer[];

int init()
{
   GetCorrectPairs();
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID);
   SetIndexBuffer(0,Pair1_Buffer);
   SetIndexLabel(0,Pair1);
   SetIndexStyle(1,DRAW_LINE,STYLE_SOLID);
   SetIndexBuffer(1,Pair2_Buffer);
   SetIndexLabel(1,Pair2);
   SetIndexStyle(2,DRAW_LINE,STYLE_SOLID);
   SetIndexBuffer(2,Pair3_Buffer);
   SetIndexLabel(2,Pair3);
   SetIndexStyle(3,DRAW_LINE,STYLE_SOLID);
   SetIndexBuffer(3,Pair4_Buffer);
   SetIndexLabel(3,Pair4);
   SetIndexStyle(4,DRAW_LINE,STYLE_SOLID);
   SetIndexBuffer(4,Pair5_Buffer);
   SetIndexLabel(4,Pair5);
   SetIndexStyle(5,DRAW_LINE,STYLE_SOLID);
   SetIndexBuffer(5,Pair6_Buffer);
   SetIndexLabel(5,Pair6);
   SetIndexStyle(6,DRAW_LINE,STYLE_SOLID);
   SetIndexBuffer(6,Pair7_Buffer);
   SetIndexLabel(6,Pair7);
   SetIndexStyle(7,DRAW_LINE,STYLE_SOLID);
   SetIndexBuffer(7,Avg_Buffer);
   SetIndexLabel(7,"Sell Avg");

   return(0);
}

int deinit()
{
   
   return(0);
}

int start()
{
   int i, limit;
   int counted_bars = IndicatorCounted();
   double Sum;
   int Num;

   if(counted_bars < 0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars > 0) counted_bars--;

   limit=BarsBack;

   for(i=0; i<limit; i++)
   {
     Sum = 0;
     Num = 0;
     if (StringLen(Pair1) > 0)
     {
       Pair1_Buffer[i] = iRSI(Pair1, 0, RSI_Period, PRICE_CLOSE, i);
       Sum += Pair1_Buffer[i];
       Num++;
     } 
     if (StringLen(Pair2) > 0)
     {
       Pair2_Buffer[i] = iRSI(Pair2, 0, RSI_Period, PRICE_CLOSE, i);
       Sum += Pair2_Buffer[i];
       Num++;
     } 
     if (StringLen(Pair3) > 0)
     {
       Pair3_Buffer[i] = iRSI(Pair3, 0, RSI_Period, PRICE_CLOSE, i);
       Sum += Pair3_Buffer[i];
       Num++;
     } 
     if (StringLen(Pair4) > 0)
     {
       Pair4_Buffer[i] = iRSI(Pair4, 0, RSI_Period, PRICE_CLOSE, i); 
       Sum += Pair4_Buffer[i];
       Num++;
     } 
     if (StringLen(Pair5) > 0)
     {
      Pair5_Buffer[i] = iRSI(Pair5, 0, RSI_Period, PRICE_CLOSE, i); 
       Sum += Pair5_Buffer[i];
       Num++;
     } 
     if (StringLen(Pair6) > 0)
     {
      Pair6_Buffer[i] = iRSI(Pair6, 0, RSI_Period, PRICE_CLOSE, i); 
       Sum += Pair6_Buffer[i];
       Num++;
     } 
     if (StringLen(Pair7) > 0)
     {
      Pair7_Buffer[i] = iRSI(Pair7, 0, RSI_Period, PRICE_CLOSE, i);
       Sum += Pair7_Buffer[i];
       Num++;
     } 
     Avg_Buffer[i] = Sum / Num; 
   }


return(0);
}

void GetCorrectPairs()
{
   Pair1 = GetCorrectSymbol(mPair_1);
   Pair2 = GetCorrectSymbol(mPair_2);
   Pair3 = GetCorrectSymbol(mPair_3);
   Pair4 = GetCorrectSymbol(mPair_4);
   Pair5 = GetCorrectSymbol(mPair_5);
   Pair6 = GetCorrectSymbol(mPair_6);
   Pair7 = GetCorrectSymbol(mPair_7);
   
}

string GetCorrectSymbol(string pair)
{
   string AddChar, myPair;
   
   myPair = pair;
   if (StringLen(pair) > 0)
   {
   if (StringLen(Symbol()) == 7)
     {
      AddChar = StringSubstr(Symbol(), 6, 1);
      myPair = pair + AddChar;
     }
   }
   return(myPair);
   
}


Comments