Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Indicator showing only on 1 char?

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

    Indicator showing only on 1 char?

    Hello,

    I had my own indicator on say Chart A, configured it, hit Apply & OK. I can see the indicator on the chart

    I opened a new chart say Chart B, configured it, hit Apply & OK. I can see the indicator on the chart.

    I then click on Chart A, and the indicator is no longer plotted.

    When I applied the indicator on Chart B, a message was output: Indicator 'MyExpMA': Error on calling 'OnBarUpdate' method on bar 22082: You are accessing an index with a value that is invalid since it is out-of-range.

    Obviously there is an error in bar indexing. But the error doesn't come up when I only use the indicator on 1 chart.

    What could be the problem?

    Thanks, Caesar.

    #2
    Hello Skechers,

    Thank you for your note.

    That would be difficult to say without testing the indicator and reviewing the logic to see what may be occurring. Can you provide the custom indicator you are using? You can export it through Tools > Export > NinjaScript Addon. Do not check the box to export as a compiled assembly or I will not be able to review the logic. Please attach the resulting .Zip file to your reply.

    Thanks in advance; I look forward to assisting you further.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Here it is
      Attached Files

      Comment


        #4
        Hello Skechers,

        Thank you for your reply.

        I suspect it's the use of static for your Series<T> variables. Try removing that so it's just this:

        private Series<int> CrossDirection; // Define a Series<T> variable.
        private Series<double> MyMAExp; // Define a Series<T> variable.

        I'm not seeing it disappear off the first chart when this change is made.

        Please let us know if we may be of further assistance to you.​
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Awesome, worked like a charm. Many Thanks Kate!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DJ888, 04-16-2024, 06:09 PM
          4 responses
          12 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by terofs, Today, 04:18 PM
          0 responses
          11 views
          0 likes
          Last Post terofs
          by terofs
           
          Started by nandhumca, Today, 03:41 PM
          0 responses
          7 views
          0 likes
          Last Post nandhumca  
          Started by The_Sec, Today, 03:37 PM
          0 responses
          3 views
          0 likes
          Last Post The_Sec
          by The_Sec
           
          Started by GwFutures1988, Today, 02:48 PM
          1 response
          9 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Working...
          X