please I need help for Array : how to calculate the moving average of an other moving average

 

hello,

I 'm sorry for my english .

my problem is the way to calculate the moving average of an other one : for example I ' d like to have the exponential moving average of MM13

the simple code is like this :

double MM12[] ;
double mm13 [];


for (i=0 ; i<limit ; i++)
{
MM12[i] = iMA(NULL,0,13,8,MODE_EMA,PRICE_CLOSE,i);

}

for (i=0 ; i<limit ; i++)
{
MM13[i] = iMAOnArray(MM12,0,13,0,MODE_LWMA,i);


}

my problem is I 'd like to create a candlestick or a Heikin Ashi basing on moving average but when I make by creating an array variable, there 's nothing in result . so I try to collect the data by buffer double ExtMapBuffer1[];

but the result is the same .

please can you correct wrong on this code . this is inspiring of heiken Ashi smoothed

thanks

here ' s the full code

Files:
 

Your init routine should start with the function IndicatorBuffers(8) ;

You want to have 4 buffers for the indicator lines, and 4 buffers for calculations. So, the MT has to allocate space for 8 buffers.

 

Hello RMACD ;

thank you very much !! it works !!

Reason: