Can we have non-drawn buffers which are not shown in the color tab, but their value is shown in the data window?

 

I am wondering if it is possible to have non-drawn buffers which are not shown in the color tab, but their value is shown in the data window. Below is a detailed description of the problem.

I have an indicator which has four buffers. Two of them are drawn on the chart, showing some arrows. Indeed, the value of these buffers are the position of the arrows. The other two buffers are the indicator data corresponding to the candles that the arrows are pointing at. I want the arrow buffers to be shown in the color tab but not in the data window. On the other hand, I want the data buffers to be shown in the data window but not in the color tab of indicator properties. The below code is a minimal working example, but it didn't provide the desired result. Here, the data buffers are not shown in the data window. If I add buffers 3 and 4 to the preprocessor part of the code, then they are shown in the data window, but they are also shown in the color tab which is irrelevant in this case.

I would be happy to hear any improving suggestion.

#property strict

#property indicator_chart_window

// Set the number of indicator buffers that are drawn.
#property indicator_buffers 2

// Set initial setting for drawing up-factal arrows.
#property indicator_type1 DRAW_ARROW
#property indicator_color1 clrRed
#property indicator_style1 STYLE_SOLID
#property indicator_width1 1

// Set initial setting for drawing down-factal arrows.
#property indicator_type2 DRAW_ARROW
#property indicator_color2 clrBlue
#property indicator_style2 STYLE_SOLID
#property indicator_width2 1

// Indicator buffers are set.
double upFractalArrow[];
double downFractalArrow[];
double upFractalValue[];
double downFractalValue[];

// Define global variables and data types.
enum shape 
{       
   circle = 108, // Circle
   square = 110, // Square
   rhombus = 117, // Rhombus
   star = 172, // Star
   arrow = 234, // Arrow
   wing = 218 // Wing
};

// Default values for input parameters are set.
input shape inputFractalShape = wing; // Shape

// Copy inputs for possible modifications during the program.
shape fractalShape = inputFractalShape;

int OnInit()
{
// Two other buffers are required for reporting the fractal values in the data window, but they are not drawn.
   IndicatorBuffers(4);
   
// Set buffer parameters for up-fractal arrows.
   SetIndexBuffer(0, upFractalArrow, INDICATOR_CALCULATIONS);
   SetIndexLabel(0, NULL);
   SetIndexEmptyValue(0, 0.0);
   SetIndexArrow(0, fractalShape);

// Set buffer parameters for down-fractal arrows.
   SetIndexBuffer(1, downFractalArrow, INDICATOR_CALCULATIONS);
   SetIndexLabel(1, NULL);
   SetIndexEmptyValue(1, 0.0);
   SetIndexArrow(1, shape(fractalShape - 1));
   
// Set buffer parameter for up-fractal values.
   SetIndexBuffer(2, upFractalValue, INDICATOR_DATA);
   SetIndexLabel(2, "Up Fractal");
   SetIndexEmptyValue(2, 0.0);
   SetIndexStyle(2, DRAW_NONE, STYLE_SOLID, 1, clrNONE);

// Set buffer parameter for down-fractal values.
   SetIndexBuffer(3, downFractalValue, INDICATOR_DATA);
   SetIndexLabel(3, "Down Fractal");
   SetIndexEmptyValue(3, 0.0);
   SetIndexStyle(3, DRAW_NONE, STYLE_SOLID, 1, clrNONE);
   
   return(INIT_SUCCEEDED);
}

int OnCalculate
(
   const int rates_total, 
   const int prev_calculated, 
   const datetime & time[], 
   const double & open[], 
   const double & high[], 
   const double & low[], 
   const double & close[], 
   const long & tick_volume[], 
   const long & volume[], 
   const int & spread[]
)
{
   return(rates_total);
}
 
  1. Hosein Rahnama: I am wondering if it is possible to have non-drawn buffers which are not shown in the color tab, but their value is shown in the data window.

    Not possible. Buffers are always in the color tab. You can show them on the chart or not. You can show them in the Data Window or not.


  2.   SetIndexBuffer(0, upFractalArrow, INDICATOR_CALCULATIONS);
      SetIndexBuffer(2, upFractalValue, INDICATOR_DATA);
    Not valid MQL4 code.
 
William Roeder:
  1. Not possible. Buffers are always in the color tab. You can show them on the chart or not. You can show them in the Data Window or not.


  2. Not valid MQL4 code.

Thanks for your answer William. In the sample code, the two buffers upFractalValue and downFractalValue are neither in the color tab nor in the data window, so why do you say that buffers are always in the color tab? Is it possible to create a custom property window that enables such a possibility for us?

Reason: