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

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.

      JesseNinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AaronKoRn, Yesterday, 09:49 PM
      0 responses
      11 views
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Yesterday, 08:42 PM
      0 responses
      10 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Yesterday, 07:51 PM
      0 responses
      11 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,981 views
      3 likes
      Last Post jhudas88  
      Started by rbeckmann05, Yesterday, 06:48 PM
      0 responses
      9 views
      0 likes
      Last Post rbeckmann05  
      Working...
      X