Download MetaTrader 5

Indicator with discrete values

To add comments, please log in or register
Leo
86
Leo  

Hi,

I am building an indicator with discrete values (so that Buffer[i] could be defined and Buffer2[i] could not, but not in every iteration). To let them assume continue values I tell compiler to fill Buffer[i], when not defined, with Buffer[i-1]. My problem is that sometimes Buffer[i-1] is also undefined and then MetaEditor fills it with random value (e.g. 2848596949.293438). My question is, how tell the compiler "if Buffer[i-1] is a random filled number put 0 (or another value)"?

I hope to have been clear!

Thanks 

whroeder1
16105
whroeder1  
  1. Previous buffer element is i+1 not i-1. There is no [-1].
  2. Unfilled elements are set to EMPTY_VALUE (2147483647) unless you specify one.
  3. Don't double post

Leo
86
Leo  
WHRoeder:
  1. Previous buffer element is i+1 not i-1. There is no [-1].
  2. Unfilled elements are set to EMPTY_VALUE (2147483647) unless you specify one.
  3. Don't double post

Thanks!
To add comments, please log in or register