Pass Array to iCustom

 

To call a Custom Moving Average 

..............
..............

 int avg=iCustom(NULL,pPeriodo,Indicator_Directory_And_Name,
                          3,         // Period
                          0,          // Offset
                          MODE_SMA,   // Calculation method
                          PRICE_CLOSE);       // Change here.

...................

...................

this is function in Indicator

int OnCalculate(const int rates_total,

                const int prev_calculated,
                const int begin,

                const double &price[])


but how I can set &price???


I need do it beause I need calculate average with custom prices , and I need pass a array with this values.


Or I can use a IndicatorCreate to call a custom Indicator 

 

iCustom() parameters are input parameters, nothing related to OnCalculate() parameters.

You can't pass an array with iCustom and IndicatorCreate will not help. Either you use a parameter to choose which custom prices you want to calculate inside the indicator or you find a workaround to pass your custom prices from an EA to the indicator (a file or  a resource for example).

Reason: