Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error on calling 'SetState' method: An item with the same key has already been added.

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

    Error on calling 'SetState' method: An item with the same key has already been added.

    I have two indicators when applying one indicator that uses the OnRender function - there is a line of code that is causing the following warning message to appear:

    "Error on calling 'SetState' method: An item with the same key has already been added."

    The line of code that it is warning about is this:

    startPoint.Y = chartScale.GetYByValue(indicator.Values[seriesCount].GetValueAt(this.ChartBars.ToIndex - 1)) - (textFormat.FontSize / 2) - 10;

    I am looping through all the indicators and adding a label to the top of the plots that are found.

    Instead if there was a way to do this with just the local plots for the indicator I do not know of an example of that.

    #2
    the code that was used was one provided by NinjaTrader - AddPlotNames

    Comment


      #3
      Hello WHICKED,

      Do you see that error when using the indicator from the app share directly or are you making a custom item and see that error? If you are seeing this with the item from the appshare with no modifications I would need a specific example of steps you used so I can test that on my end. If you are otherwise seeing this with something you made based off of that item you would need to upload a simplified sample along with the steps that you used so we can get a better idea of what's happening.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      590 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      342 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      555 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X