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

Can someone explain this obj reference error

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

    Can someone explain this obj reference error

    I have posted some code in the EcoSystem - only to find out it later had an odd Obj Ref error. Doesn't stop the indicator working but nonetheless...
    Here is the offending code and after much nashing of teeth I discovered this little bit is the error but I do not understand why.

    Code:
        private void btn_Click(object sender, RoutedEventArgs rea)    
            {
            if(MouseClick)    // this is a bool
            MakeVisible();
         [COLOR=#c0392b] [B]  //else
            //return;[/B][/COLOR]
            }​
    In explanation I have allowed the user the option to either click the button or simple use OnMouseEnter ( ie no click).
    Why would return cause the error?
    Any explanations welcomed.

    #2
    Hello Mindset,

    I'm not able to reproduce.

    Attached is a simple test script.
    ButtonClickReturnTest_NT8.zip

    Are you certain the issue is not within the MakeVisible() method?
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Well I suppose it could be but I can’t see it.

      here is a link to the entire code. With the error lines included.
      if I remove them the error disappears.

      Comment


        #4
        Hello Mindset,

        The script you have provided does not call return in the btn_Click handler method that I can see.

        I recommend you make a copy of the script. Then remove all other logic except for the specific code you are investigating.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Torontobluejays, Today, 08:43 AM
        0 responses
        1 view
        0 likes
        Last Post Torontobluejays  
        Started by sastrades, 01-31-2024, 10:19 PM
        12 responses
        191 views
        0 likes
        Last Post sastrades  
        Started by Jimmyk, 01-26-2018, 05:19 AM
        8 responses
        864 views
        0 likes
        Last Post emuns
        by emuns
         
        Started by giulyko00, 04-24-2024, 12:03 PM
        6 responses
        29 views
        0 likes
        Last Post giulyko00  
        Started by 00nevest, 04-27-2024, 02:27 PM
        3 responses
        27 views
        0 likes
        Last Post 00nevest  
        Working...
        X