Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Empty value for an array

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Empty value for an array

    Hello!

    I have a piece of code from MT4.
    I have a line with the expression
    HTML Code:
    if (Low[i] == EMPTY_VALUE)
    Usually, I transform "Low[i] = EMPTY_VALUE" to Low.Reset(i);
    But this will not be possible with a boolean.

    Coluld someone advise me how to replace the term"EMPTY_VALUE"?

    Thanks in davnace.

    #2
    Hello Stanfillirenfro,

    Thank you for your note.

    A bool can only be one of the two values, either true or false. If you need some kind of special flag you will need to use an Int series and use 1,0, and -1 for the sentinel value.

    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Many thanks Kate for your reply.

      For the boolean it is clear. But let's imagine that I do not have any boolean.

      Please what could e the equivalent of "EMPTY_VALUE" in Ninjatrader?

      Thanks!
      Last edited by Stanfillirenfro; 11-24-2021, 11:36 AM.

      Comment


        #4
        Hello Stanfillirenfro,

        Thank you for your reply.

        As mentioned previously, you could use an int series instead of a bool. Set it to 1 when the bool would be true, -1 if false, and 0 for empty.

        Please let us know if we may be of further assistance to you.

        Comment


          #5
          Many thanks Kate!

          It is clear!

          Thanks again!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          571 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          330 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          548 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          549 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X