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

Does not contain a definition for...

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

    Does not contain a definition for...

    I often 'save as' one of my existing custom indicators so I can edit it and make a new indicator. This is the simplest way for me.

    The problem is after I change variable names or remove old variables, then compile, I will get the error in Ninja generated code "Does not contain a definition for..." then name a deleted variable. The rest of the code is correct. It's just hanging on to old variables.

    What is the correct way to avoid this error going forward?

    Thank you.
    Last edited by imalil; 01-09-2017, 07:46 PM.

    #2
    Hello,

    Thank you for the post.

    Can you tell me, does this only occur with your custom script or can you get the same result using one of the included indicators? If there is an included indicator that also does this when you save as, I would like to try the same steps to also see the result. Otherwise if this requires the custom script, can you provide an example for me to test and see this outcome?

    The NinjaScript generated code can generally be cleared out if there is a problem and upon compiling it should be generated. If you are seeing other errors still, there may be a syntax reason for the errors. In any case, I would likely need to see some example of the error and I could provide further assistance.


    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for replying.

      I'm running into this problem again. I fixed it before by copy/pasting the entire indicator into a new indicator, which worked, but I want to try what you mentioned.

      When you say "The NinjaScript generated code can generally be cleared out if there is a problem and upon compiling it should be generated.", what EXACTLY do you mean by 'cleared out'? What is the correct way to clear out this code?

      I know this is a silly question, but my way of clearing out is not working.

      Thanks.

      Comment


        #4
        I copy/pasted the indicator into a fresh indicator and it compiles fine, but it is not showing up in my indicator list. And in fact an indicator that is excluded from compilation is in the list.

        What is the reason for this?

        Thank you.

        Comment


          #5
          Originally posted by imalil View Post
          I copy/pasted the indicator into a fresh indicator and it compiles fine, but it is not showing up in my indicator list. And in fact an indicator that is excluded from compilation is in the list.

          What is the reason for this?

          Thank you.
          There are 3 places for a name in NT8.

          Filename (save as)
          ClassName
          and most importantly--> the actual name

          Code:
          		protected override void OnStateChange()
          		{
          			if (State == State.SetDefaults)
          			{
          				Description							= @"Enter the description for your new custom Strategy here.";
          				Name								= "MyCustomStrategyXXES9c4";

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by cmtjoancolmenero, Yesterday, 03:58 PM
          5 responses
          28 views
          0 likes
          Last Post cmtjoancolmenero  
          Started by gbourque, Today, 06:39 AM
          2 responses
          14 views
          0 likes
          Last Post gbourque  
          Started by rexsole, Today, 08:39 AM
          0 responses
          4 views
          0 likes
          Last Post rexsole
          by rexsole
           
          Started by trilliantrader, Yesterday, 03:01 PM
          3 responses
          31 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by Brevo, Today, 01:45 AM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Working...
          X