Array empty value

Back to topics list To post a new topic, please log in or register
avatar
10
Boyan 2015.03.13 10:26
 

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. 

avatar
Moderator
3425
GumRai 2015.03.13 10:39 #
 
Are you talking about arrays or Buffers?
avatar
2017
gooly 2015.03.13 10:42 #
 
EMPTY_VALUE = 214783647 while EMPTY = 0!
avatar
10
Boyan 2015.03.13 11:02 #
 
GumRai:
Are you talking about arrays or Buffers?

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

  

avatar
Moderator
3425
GumRai 2015.03.13 11:55 #
 
Boyan:

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

  

Use SetIndexEmptyValue and set it to zero
avatar
10
Boyan 2015.03.13 12:36 #
 
GumRai:
Use SetIndexEmptyValue and set it to zero

Yup, job done.

Thank you

avatar
13009
WHRoeder 2015.03.13 13:12 #
 
gooly: EMPTY_VALUE = 214783647 while EMPTY = 0!
EMPTY = -1

avatar
2017
gooly 2015.03.13 14:06 #
 
ah, ok, haven't found it in the reference and it was what I remembered.
avatar
10
Boyan 2015.03.13 14:12 #
 

Thank you guys. U R awesome

 

Back to topics list  

To add comments, please log in or register