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 arvidvanstaey, Today, 02:19 PM
          4 responses
          11 views
          0 likes
          Last Post arvidvanstaey  
          Started by samish18, 04-17-2024, 08:57 AM
          16 responses
          60 views
          0 likes
          Last Post samish18  
          Started by jordanq2, Today, 03:10 PM
          2 responses
          9 views
          0 likes
          Last Post jordanq2  
          Started by traderqz, Today, 12:06 AM
          10 responses
          18 views
          0 likes
          Last Post traderqz  
          Started by algospoke, 04-17-2024, 06:40 PM
          5 responses
          47 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X