Array empty value

 

Hi There,

I am having an issue with arrays. I’m using this code as a part of my program

 

  PreviousUpTick = CurrentUpTick;
      CurrentUpTick = Ask;
   PreviousDnTick = CurrentDnTick;
      CurrentDnTick = Ask;
   
   if (CurrentUpTick < PreviousUpTick ) 
       DnTick[0]++;
   if (CurrentDnTick > PreviousDnTick ) 
       UpTick[0]--;
       Draw[0]= UpTick[0]+DnTick[0];

 

When using only this simple code to bump up or down a histogram it works well. Every array starts at value 0 and gets added or subtracted accordingly by 1 on every iteration. When I use this in another script that plots objects instead on a histogram the arrays are getting assigned EMPTY_VALUE, so it starts bumping up or down from 214783647 instead of 0 although I initialized all arrays with 0.

 

I would appreciate any help or clue.

Thanks. 

 
Are you talking about arrays or Buffers?
 
EMPTY_VALUE = 214783647 while EMPTY = 0!
 
GumRai:
Are you talking about arrays or Buffers?

I'm talking abot buffers. Sorry for not being precise.

 
Boyan:

I'm talking abot buffers. Sorry for not being precise.

  

Use SetIndexEmptyValue and set it to zero
 
GumRai:
Use SetIndexEmptyValue and set it to zero

Yup, job done.

Thank you

 
gooly: EMPTY_VALUE = 214783647 while EMPTY = 0!
EMPTY = -1
 
ah, ok, haven't found it in the reference and it was what I remembered.
 

Thank you guys. U R awesome

Reason: