Download MetaTrader 5

Previous indicator's data

To add comments, please log in or register
Deposit to your account via Visa QIWI Wallet
kemalturgay
265
kemalturgay 2015.01.03 15:36 

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
9889
Rodrigo Malacarne 2015.01.17 08:18  
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
30702
Alain Verleyen 2015.01.17 08:26  
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 2015.01.18 23:31  
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