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 Karado58, 11-26-2012, 02:57 PM
      8 responses
      14,825 views
      0 likes
      Last Post Option Whisperer  
      Started by Option Whisperer, Today, 09:05 AM
      0 responses
      1 view
      0 likes
      Last Post Option Whisperer  
      Started by cre8able, Yesterday, 01:16 PM
      3 responses
      11 views
      0 likes
      Last Post cre8able  
      Started by Harry, 05-02-2018, 01:54 PM
      10 responses
      3,203 views
      0 likes
      Last Post tharton3  
      Started by ChartTourist, Today, 08:22 AM
      0 responses
      6 views
      0 likes
      Last Post ChartTourist  
      Working...
      X