Paires V_5

This technical indicator is designed to provide a comprehensive visual overlay on a trading chart, combining multiple statistical and trend-following tools into a single view. It aims to help traders identify price trends, volatility levels, and specific momentum shifts by synthesizing several classic market analysis methods simultaneously.

Core Components and Functionality

The logic behind this script can be broken down into four main analytical categories:

1. Trend Analysis via Moving Averages The script calculates up to three distinct Moving Averages (MAs). This allows for a multi-layered approach to trend identification:

  • Customization: Each moving average can be configured independently based on its period, its calculation style (such as Simple, Exponential, Linear Weighted, or Smoothed), and the specific price data it follows (e.g., Highs, Lows, Open, Close, etc.).
  • Visual Strategy: By tracking different price points (like the High of a candle versus the Low), the script helps traders visualize the "envelope" of recent price action rather than just a single average line.

2. Volatility and Boundary Tracking (Bollinger Bands) The indicator incorporates Bollinger Bands, which are used to measure market volatility.

  • It identifies a central moving average and creates upper and lower "bands."
  • These bands provide a visual representation of the standard deviation of price movement, helping traders identify overbought or oversold conditions when the price pushes to the outer limits.

3. Momentum and Trend Reversal (Parabolic SAR) To assist with specific entry and exit timing, the script includes a Parabolic Stop and Reverse (SAR) indicator.

  • This appears as distinct dots on the chart that move in opposition to the price trend.
  • It is designed to help identify potential acceleration in a trend or early signals of a trend reversal.

4. Dynamic Price Action Visualization Beyond the standard indicators, the script performs a unique visual reconstruction of the price history:

  • Candle Simulation: It draws specific trend objects to represent the "Body" (the range between Open and Close) and the "Wicks" (the High and Low) of historical candles.
  • Color Coding: These structures are dynamically colored—typically Green for upward movement and Red for downward movement—providing a clear, high-contrast history of price action.
  • Real-Time Tracking: It maintains a horizontal reference line that tracks the current market price in real-time, ensuring the user always has a baseline for the latest trade activity.

Summary of User Experience

For a trader using this tool, the logic provides a "all-in-one" dashboard. Instead of looking at five different windows, the user sees a single chart where the core trend (Moving Averages), the market's boundaries (Bollinger Bands), reversal signals (SAR), and a color-coded history of price movement are all synchronized. This allows for a more holistic view of whether the current price movement is supported by broader trends or represents an extreme deviation from the norm.

Price Data Components
Series array that contains the highest prices of each barSeries array that contains the lowest prices of each barSeries array that contains open prices of each barSeries array that contains close prices for each bar
Indicators Used
Moving average indicatorBollinger bands indicatorParabolic Stop and Reverse system
Miscellaneous
Implements a curve of type %1
9 Views
0 Downloads
0 Favorites
Paires V_5

#property indicator_separate_window

#property indicator_buffers 8
#property indicator_color1 Black
#property indicator_color2 Black
#property indicator_color3 Black
#property indicator_color4 Black
#property indicator_color5 Black
#property indicator_color6 Black
#property indicator_color7 Black
#property indicator_color8 Black





extern string paire  = "EURGBP";
extern int Time_frime= 0;

extern bool      Show_SAR =1;
extern double    Step=0.02;
extern double    Maximum=0.2;
extern color color_SAR = Red;

extern bool      Show_BB  =1;
extern int       BandsPeriod=20;
extern double    BandsDeviations=2.0;
extern color color_BB = Black;

extern bool      Show_MA_1  =1;
extern int       PRD_1=34;
extern string price ="CLOSE";
extern string ma_style ="EMA";
extern color color_MA1 = Black;



extern bool      Show_MA_2  =1;
extern int       PRD_2=34;
extern string price_ma2 ="HIGH";
extern string ma_style_ma2 ="EMA";
extern color color_MA2 = Black;


extern bool      Show_MA_3  =1;
extern int       PRD_3=34;
extern string price_ma3 ="LOW";
extern string ma_style_ma3 ="EMA";
extern color color_MA3 = Black;


extern color     Up= Green;
extern color     Down = Red;
extern color     ligne_prix= Black;
extern int Corps= 3;
extern int Meches=1;
double ind_1[];
double ind_2[];
double ind_3[];
double ind_4[];
double ind_5[];
double ind_6[];
double ind_7[];
double ind_8[];


int init() {
   IndicatorShortName(paire);
   SetIndexStyle(0, DRAW_LINE,0,1,color_BB);
   SetIndexBuffer(0, ind_1);
   SetIndexStyle(1, DRAW_LINE,0,1,color_BB);
   SetIndexBuffer(1, ind_2);
   SetIndexStyle(2, DRAW_LINE,0,1,color_BB);
   SetIndexBuffer(2, ind_3);
   SetIndexStyle(3,DRAW_ARROW,0,0,color_SAR);
   SetIndexArrow(3,159);
   SetIndexBuffer(3,ind_4);
   SetIndexStyle(4, DRAW_LINE,0,1,color_MA1);
   SetIndexBuffer(4, ind_5);
   SetIndexStyle(5, DRAW_LINE,0,1,color_MA2);
   SetIndexBuffer(5, ind_6);
   SetIndexStyle(6, DRAW_LINE,0,1,color_MA3);
   SetIndexBuffer(6, ind_7);
   SetIndexStyle(7, DRAW_NONE);
   SetIndexBuffer(7, ind_8);
   
   

   return (0);
}

int deinit() {
   Comment("");
   return (0);
}

int start() {
   
   string l_name_44;
   string l_name_52;
 
   string ls_0 = paire;
   int li_8 = WindowFind(ls_0);
   double prix,mode;
   double prix2,mode2;
   double prix3,mode3;


   for (int i = 0; i < Bars; i++) {
   for (int k = i; k < 10 + i; k++) 
   for (k = i; k < 10 + i; k++) 
      
       {
                                                                  // Définition du prix pour la moyenne 1
     if (price == "CLOSE")                  prix= PRICE_CLOSE;
     if (price == "TYPICAL")                prix= PRICE_TYPICAL;
     if (price == "HIGH")                   prix= PRICE_HIGH;
     if (price == "LOW")                    prix= PRICE_LOW;
     if (price == "OPEN")                   prix= PRICE_OPEN;
     if (price == "MEDIAN")                 prix= PRICE_MEDIAN;
     if (price == "WEIGHTED")               prix= PRICE_WEIGHTED;
                                                                 // Définition du style moving average pour la moyenne 1
 
     if (ma_style == "SMA")                 mode= MODE_SMA;
     if (ma_style == "EMA")                 mode= MODE_EMA;
     if (ma_style == "LWMA")                mode= MODE_LWMA;
     if (ma_style == "SMOOT")               mode= MODE_SMMA;
     if (Show_MA_1 == 1)  ind_5[i]= iMA(paire,Time_frime,PRD_1,0,mode,prix,i);
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                                                           // Définition du prix pour la moyenne 2
     if (price_ma2 == "CLOSE")                  prix2= PRICE_CLOSE;
     if (price_ma2 == "TYPICAL")                prix2= PRICE_TYPICAL;
     if (price_ma2 == "HIGH")                   prix2= PRICE_HIGH;
     if (price_ma2 == "LOW")                    prix2= PRICE_LOW;
     if (price_ma2 == "OPEN")                   prix2= PRICE_OPEN;
     if (price_ma2 == "MEDIAN")                 prix2= PRICE_MEDIAN;
     if (price_ma2 == "WEIGHTED")               prix2= PRICE_WEIGHTED;
                                                                 // Définition du style moving average pour la moyenne 2
 
     if (ma_style_ma2 == "SMA")                 mode2= MODE_SMA;
     if (ma_style_ma2 == "EMA")                 mode2= MODE_EMA;
     if (ma_style_ma2 == "LWMA")                mode2= MODE_LWMA;
     if (ma_style_ma2 == "SMOOT")               mode2= MODE_SMMA;
     if (Show_MA_2 == 1)  ind_6[i]= iMA(paire,Time_frime,PRD_2,0,mode2,prix2,i);
     //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
                                                           // Définition du prix pour la moyenne 3
     if (price_ma3 == "CLOSE")                  prix3= PRICE_CLOSE;
     if (price_ma3 == "TYPICAL")                prix3= PRICE_TYPICAL;
     if (price_ma3 == "HIGH")                   prix3= PRICE_HIGH;
     if (price_ma3 == "LOW")                    prix3= PRICE_LOW;
     if (price_ma3 == "OPEN")                   prix3= PRICE_OPEN;
     if (price_ma3 == "MEDIAN")                 prix3= PRICE_MEDIAN;
     if (price_ma3 == "WEIGHTED")               prix3= PRICE_WEIGHTED;
                                                                 // Définition du style moving average pour la moyenne 3
 
     if (ma_style_ma3 == "SMA")                 mode3= MODE_SMA;
     if (ma_style_ma3 == "EMA")                 mode3= MODE_EMA;
     if (ma_style_ma3 == "LWMA")                mode3= MODE_LWMA;
     if (ma_style_ma3 == "SMOOT")               mode3= MODE_SMMA;
     if (Show_MA_3 == 1)  ind_7[i]= iMA(paire,Time_frime,PRD_3,0,mode3,prix3,i);
     
     ind_8[i]= iMA(paire,Time_frime,1,0,MODE_SMA,PRICE_CLOSE,i);




       if (Show_BB == 1)    ind_1[i]= iMA(paire,Time_frime,BandsPeriod,0,MODE_SMA,PRICE_CLOSE,i);
       if (Show_BB == 1)    ind_2[i]= iBands(paire,Time_frime,BandsPeriod,BandsDeviations,0,PRICE_CLOSE,MODE_LOWER,i);
       if (Show_BB == 1)    ind_3[i]= iBands(paire,Time_frime,BandsPeriod,BandsDeviations,0,PRICE_CLOSE,MODE_UPPER,i);
       if (Show_SAR == 1)   ind_4[i]= iSAR(paire,Time_frime,Step,Maximum,i);

        
        
        
        }
   }
   Sleep(1000);
   ObjectsDeleteAll(li_8);
   for (k = 0; k <= Bars; k++) {
      l_name_44 = "TimingHL" + k;
      ObjectCreate(l_name_44, OBJ_TREND, li_8, Time[k], iHigh(paire,Time_frime,k), Time[k], iLow(paire,Time_frime,k));
      ObjectSet(l_name_44, OBJPROP_STYLE, STYLE_SOLID);
      ObjectSet(l_name_44, OBJPROP_RAY, FALSE);
      ObjectSet(l_name_44, OBJPROP_WIDTH, Meches);
      l_name_52 = "TimingOC" + k;
      ObjectCreate(l_name_52, OBJ_TREND, li_8, Time[k], iOpen(paire,Time_frime,k), Time[k], iClose(paire,Time_frime,k));
      ObjectSet(l_name_52, OBJPROP_STYLE, STYLE_SOLID);
      ObjectSet(l_name_52, OBJPROP_RAY, FALSE);
      ObjectSet(l_name_52, OBJPROP_WIDTH, Corps);
      if (iOpen(paire,Time_frime,k) <= iClose(paire,Time_frime,k)) {
      ObjectSet(l_name_44, OBJPROP_COLOR, Up);
      ObjectSet(l_name_52, OBJPROP_COLOR, Up);
      } else {
      ObjectSet(l_name_44, OBJPROP_COLOR, Down);
      ObjectSet(l_name_52, OBJPROP_COLOR, Down);
      }
   }
     ObjectCreate("actuel_price", OBJ_HLINE, li_8, 0, iClose(paire,Time_frime,0));
     ObjectSet("actuel_price", OBJPROP_COLOR, ligne_prix);
   return (0);
}

Comments