Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Indicator showing error in NinjaScript Output although indicator is not in the Chart

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

    Indicator showing error in NinjaScript Output although indicator is not in the Chart

    Hi,

    I have an indicator which had (now is corrected) a logical error: I defined an array of 20 terms but in the code I was looping for 30 terms.

    I didn't have this indicator in any chart, but allways I opened the indicator window of an existing chart, an error appeared in my NinjaScript Output window.

    So, it was as if NT were running this "not inserted" indicator and showed the "logical" error.

    I corrected the code and then it stopped to show the error.

    Is this normal?

    #2
    Hello artson,

    When you open the indicator window all indicators are created to get the defaults. If you were getting an error when opening the window that points to a problem in the indicators OnStateChange override.

    Comment


      #3
      Hi, I think I din't express it correctly.

      Is it possible, that in a chart, just opening the indicator window in order to insert an indicator, but still not selecting any indicator, the NT shows an error in the Output, because a coded indicator has this error?????

      It is clear, that if an indicator has in its code, an array of 20 members, and during the execution I will look up for the position array[21], it will show an error.
      This is clear.
      But I would understand, that as long as I don't use this "wrong" indicator, no error message should appear.....

      But this was not my case.
      I had a chart, I opened the indicator window to insert an indicator, and before I selected any, the error messega was already there....

      Is this normal?

      (I mean, I have corrected my "wrong" indicator and I don't see this error anymore, but to check if this could be a bug....

      Comment


        #4
        Hello artson,

        I understood the question, yes thats normal. All indicators are created when you open that window. Your indicator had an error in its OnStateChange override.

        Comment


          #5
          Thanks a lot Jesse!!!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          77 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          45 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          28 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          32 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          64 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X