Hello,

i want to know how can i transfer custom indicators code into EA, i can do it with rather simple indicators but i have problem with more complicated ones like when they have functions outside the start function and they use these two dimensional arrays for memorizing the previous values like this one

Code: Select all

```
#define E1 0
#define E2 1
#define E3 2
#define E4 3
#define E5 4
#define E6 5
#define res 6
//
//
//
//
double stored[][14];
double
iAverage(double price, double averagePeriod, double tconst, bool adaptive, int i, int ashift=0)
{
if (ArrayRange(stored,0) != Bars) ArrayResize(stored,Bars);
if(averagePeriod <=1) return(price);
int r = Bars-i-1;
double e1=stored[r-1][E1+ashift]; double e2=stored[r-1][E2+ashift];
double e3=stored[r-1][E3+ashift]; double e4=stored[r-1][E4+ashift];
double e5=stored[r-1][E5+ashift]; double e6=stored[r-1][E6+ashift];
```

i just want to learn i searched allover the internet but i couldn't find anything, and i just want a hint,

guide me please...