Download MetaTrader 5

Previous indicator's data

To add comments, please log in or register
kemalturgay
265
kemalturgay  

When I want to apply the example indicator from the reference (shown below) to a different indicator by dragging it from the navigator window, why is the "previous indicator's data" option not shown on the indicator parameters windows? Thanks.


#property indicator_chart_window
#property indicator_buffers 1
#property indicator_plots   1
//---- plot Label1
#property indicator_label1  "Label1"
#property indicator_type1   DRAW_LINE
#property indicator_color1  clrRed
#property indicator_style1  STYLE_SOLID
#property indicator_width1  1
//--- indicator buffers
double         Label1Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
void OnInit()
  {
//--- indicator buffers mapping
   SetIndexBuffer(0,Label1Buffer,INDICATOR_DATA);
//---
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &price[])
 
  {
//---
   Print("begin = ",begin,"  prev_calculated = ",prev_calculated,"  rates_total = ",rates_total);
//--- return value of prev_calculated for next call
   return(rates_total);
  }
Rodrigo Malacarne
Moderator
10579
Rodrigo Malacarne  
kemalturgay:

When I want to apply the example indicator from the reference (shown below) to a different indicator by dragging it from the navigator window, why is the "previous indicator's data" option not shown on the indicator parameters windows? Thanks.


Hello kemalturgay,

This option is not present for all indicators, as most of the indicators have calculation procedures which do not take into account other indicator buffers.

So if you want to apply an indicator to other indicators, usually you have to do that programmatically.

Regards,
Malacarne 

Alain Verleyen
Moderator
33611
Alain Verleyen  
kemalturgay:

When I want to apply the example indicator from the reference (shown below) to a different indicator by dragging it from the navigator window, why is the "previous indicator's data" option not shown on the indicator parameters windows? Thanks.


To which indicator already present are you trying to apply it ?
kemalturgay
265
kemalturgay  
angevoyageur:
To which indicator already present are you trying to apply it ?

I tried it with accelarator oscillator with great caution ...

But I retried it now and it is working.

No problem now.


Malacarne ... thanks a lot.

To add comments, please log in or register