Download MetaTrader 5
To add comments, please log in or register
Join MQL5 Cloud Network. Start earning money!
Keith Watford
Moderator
7982
Keith Watford 2014.04.18 08:49 

Hi,

I know that it must be possible, but I have been unable to find out how.

I use some buffers just for calculations that I don't really want to display in the data window.

using INDICATOR_CALCULATIONS in SetIndexBuffer seems like it may be the way to go, but as usual, the documentation is not very clear.

Can anybody please tell me how?

Thank you :)

Carl Schreiber
5959
Carl Schreiber 2014.04.18 08:55  
Look in the reference for IndicatorBuffers() and use its example..
honest_knave
969
honest_knave 2014.04.18 09:01  
#property indicator_buffers   1

int OnInit(void)
  {
   IndicatorBuffers(2);   
   SetIndexBuffer(0,InDataWindow, INDICATOR_DATA);
   SetIndexBuffer(1,NotInDataWindow, INDICATOR_CALCULATIONS);
   ...
Keith Watford
Moderator
7982
Keith Watford 2014.04.18 09:21  

Thank you gooly and honest knave, I have already tried your suggestions, but I guess that i must be missing something because they still appear in the data window.

I will read through again and try to find what I am missing

honest_knave
969
honest_knave 2014.04.18 09:35  

What do you get in the Data Window with this?

#property strict
#property indicator_chart_window
#property indicator_buffers   1

double InDataWindow[], NotInDataWindow[];

int OnInit()
  {
   IndicatorBuffers(2);
   SetIndexBuffer(0,InDataWindow, INDICATOR_DATA);
   SetIndexBuffer(1,NotInDataWindow, INDICATOR_CALCULATIONS);
   SetIndexLabel(0,"See Me");
   SetIndexLabel(1,"Don't See Me");
   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);
  }
Carl Schreiber
5959
Carl Schreiber 2014.04.18 09:36  

Be aware of the difference of

#property indicator_buffers   1

and

IndicatorBuffers(2);
Keith Watford
Moderator
7982
Keith Watford 2014.04.18 10:24  

Thanks Guys,

I have got it now.

That was the one line that I missed

I should have saved myself a lot of frustration and asked earlier :)

IndicatorBuffers(2);
/
To add comments, please log in or register