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 without an indicator name

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

    Error without an indicator name

    Ninja 8 Update 11

    One of my customers is reporting an error. I don't know if it's my indicator causing this error. But what intrigues me is that the error is being reported with a blank indicator name. I'm not quite clear how an indicator could not have a name.

    Do you have to explicitly set a 'Name' for the indicator to have a name, or would you have to say ' Name = "" ' in order to get rid of the name?
    Attached Files
    Last edited by bubblegum; 06-11-2016, 02:28 AM.

    #2
    So I wrote some code to specifically generate a 'Collection was modified' error, and it doesn't generate an error! grrrrrrrr...

    Code:
    			if ( Math.IEEERemainder(CurrentBar, 2) == 0 )
    			{
    				Rectangle myRect = Draw.Rectangle(this, "hello:"+CurrentBar.ToString(), 5, High[0], 0, Low[0], Brushes.Blue);
    			}
    			else
    			{
    				Rectangle myRect = Draw.Rectangle(this, "goodbye:"+CurrentBar.ToString(), 5, High[0], 0, Low[0], Brushes.DarkMagenta);
    			}
    			
    			if ( CurrentBar == 100)
    			{
    				foreach (IDrawingTool rectangle in DrawObjects)
    				{
    					if (rectangle.Tag.StartsWith("hello:"))
    					{
    						RemoveDrawObject(rectangle.Tag);
    					}
    				}
    			}

    Comment


      #3
      Hello bubblegum,

      Thank you for writing in.

      The Name property would need to be explicitly set to "" (or string.Empty) in order to show up blank as shown in the screenshot provided.

      If a Name is not specified at all (the Name property deleted entirely from State.SetDefaults, for example), the name will take on the class name of the indicator.

      If you have specified a Name for the indicator, the customer may be referring to a different indicator in this case.

      Are you able to confirm if the customer is referring to your indicator in particular?
      Zachary G.NinjaTrader Customer Service

      Comment


        #4
        Thanks. I'm pretty sure it's not my indicators. I do set the Name in State.SetDefaults. And I forced an error in my indicator and it shows the error in the NT log/trace with the correct name. Strange that someone is setting Name = "" !

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by fwendolynlpxz, Today, 05:19 AM
        0 responses
        3 views
        0 likes
        Last Post fwendolynlpxz  
        Started by traderqz, Yesterday, 12:06 AM
        11 responses
        28 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by PaulMohn, Today, 03:49 AM
        0 responses
        8 views
        0 likes
        Last Post PaulMohn  
        Started by inanazsocial, Today, 01:15 AM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Jason  
        Started by rocketman7, Today, 02:12 AM
        0 responses
        11 views
        0 likes
        Last Post rocketman7  
        Working...
        X