# Array Conflict Help

I have the following functions below. When one function is called up with out the other being called up, There is no conflict. The conflict is noticed when order blocks have to be drawn on the chart. When both functions are called up, the order blocks are failing to be drawn. What code in each function could be causing the conflict? Function 1 is PikBar function 2 is NextImpulseUp
```//+------------------------------------------------------------------+
//| Get PikBar                                                       |
///+------------------------------------------------------------------+
int   PikBar(ENUM_TIMEFRAMES timeframe,int mode, int shoulder, int startBar,int peakNo)
{
int barIndex=0;
int ar[]; // Array
ArrayResize(ar,1900+1); // Prepare the array
for(int y=3; y<=1900; y++)
{
ar[0]=0; // Set the values
ar[1]=FindPeak(timeframe,mode,shoulder,startBar );

ar[2]=FindPeak(timeframe,mode,shoulder,ar[1]+1 ); // Set the value for the new array element
ar[y]=FindPeak(timeframe,mode,shoulder,ar[y-1]+1 );; // Set the value for the new array element
}

for(int x=1; x<=1900; x++)
{
if(peakNo ==x)   barIndex = ar[x];
}
return barIndex;
}

//+------------------------------------------------------------------+
int   NextImpulseUp(ENUM_TIMEFRAMES timeframe,int startBar,int endBar, int impulseNo)
{
int barIndex=0;
int ari[]; // Array
ArrayResize(ari,1900+1); // Prepare the array
for(int y=3; y<=1900; y++)
{
ari[0]=0;  // Set the values
ari[1]=ImpulseUp(timeframe ,startBar, endBar );

ari[2]=ImpulseUp(timeframe ,ari[1]+1, endBar );
ari[y]=ImpulseUp(timeframe ,ari[y-1]+1, endBar );
}
for(int x=1; x<=1900; x++)
{
if(impulseNo ==x)   barIndex = ari[x];
}
return barIndex;
}
//+------------------------------------------------------------------+
```

any help coming

Bwalya Tambule #:
any help coming

You will have to provide much clearer details and more code if you want anybody to look at it

what is an array conflict?

what are the actual errors?

where is the code that calls the functions and draws the objects?

It is unclear from the posted code why there is a conflict.

There are two different arrays ar[] and ari[] that do different things but until now there is no conflict.

The conflict may arise in the further processing of the functions' results which is not visible here.
Reason: