First Indicator Data Calculation for x indicator

 

Hello everyone.... I noticed that MT4 has an option on its original indicators to drag and drop for example an ma on an indicator and choose to calculate on "first indicator data" or "previous indicator data"... wich is very usefull to make indicators of indicators...

Now my question here to coders : what should we add to an x Custom indicator code in order to have this option of calculating on "first indicator data" or "previous indicator data" so in this case we could drag and drop an x custom indicator and choose to calculate over this other custom indicator data...

Wouldnt that be cool ?... I would love to hear your inputs... cheers Dave.

 

Let's say we want to calculate the MA of RSI ,we need to define an Array(here it will be the RSI of last 14 periods on price_close) ,then we can use the function iMAOnArray() to calculate the moving average of the array ...

double rsi_buffer[300];

int i,limit=ArraySize(rsi_buffer);

ArraySetAsSeries(macd_buffer,true);

for(i=0; i<limit; i++)

rsi_buffer=iRSI(NULL,0,14,PRICE_CLOSE,i);

double maofrsi=iMAOnArray(rsi_buffer,0,5,0,MODE_SMA,0);

 
strategy100:
Hello everyone.... I noticed that MT4 has an option on its original indicators to drag and drop for example an ma on an indicator and choose to calculate on "first indicator data" or "previous indicator data"... wich is very usefull to make indicators of indicators...

Now my question here to coders : what should we add to an x Custom indicator code in order to have this option of calculating on "first indicator data" or "previous indicator data" so in this case we could drag and drop an x custom indicator and choose to calculate over this other custom indicator data...

Wouldnt that be cool ?... I would love to hear your inputs... cheers Dave.

It would be great but unfortunately it is not possible.

I do this by coding a new indicator that uses the other custom indicator instead of the price.

 
cucurucu:
It would be great but unfortunately it is not possible. I do this by coding a new indicator that uses the other custom indicator instead of the price.

cucurucu,

Can you please post a sample code using the data from an indicator (instead of using previous indicator's value)?

Thanks.