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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      46 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      22 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      33 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      50 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      42 views
      0 likes
      Last Post CarlTrading  
      Working...
      X