Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Compiler error

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

    Compiler error

    After compiling, I get this error message:

    The type "NinjaTradier Strategy LinRegX already contains a definition for 'MN',

    The following error code is indicated; cs 0102. This error code is defined as a type defined more than once.

    MN is defined originally as an input variable: MN = 10 (default value).

    It is also defined in Properties:

    [Description("")]
    [Category(
    "Parameters")]
    publicint MN
    {
    get { return mn; }
    set { mn = Math.Max(1, value); }

    How do I correct this? Should I delete the Properties entry? All my other input variables are also listed in Properties. Will I have the same duplication problem?

    Also, what is the Microsoft URL for defining the cs error codes? (All the codes are not available in Ninja.)

    Thanks for any help.

    #2
    Please see the MACD indicator for an example. You need to be mindful of what is capitalized and what is not.

    private int mn = 10;

    Lower case in the Variables region of your code.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Still getting same error.

      I am still getting the same compile errors:
      Your strategy likely holds one or more recursive properties which could cause NinjaTrading to crash: mn, abuff, bbuff, cbuff, dburr. Do you want to edit these properties.

      The mn propertites are:
      [Description("")]
      [Category(
      "Parameters")]
      public int mn
      {
      get { return mn; }
      set { mn = Math.Max(1, value); }
      }

      MACD code did not help.

      The pertinent Variables declarations are :
      #region Variables
      // Wizard generated variables
      privateint mn = 10; // Default setting for mn
      privatedouble abuff = 0.0008; // Default setting for abuff
      privatedouble bbuff = 0.0016; // Default setting for bbuff
      privatedouble cbuff = 0; // Default setting for cbuff
      privatedouble dbuff = 0.0002; // Default setting for dbuff
      // User defined variables (add any user defined variables below)
      #endregion


      How can I identify and correct?

      Comment


        #4
        public int mn needs to be MN. Capitalized.
        Josh P.NinjaTrader Customer Service

        Comment


          #5
          Where do I find the rules?

          I thought all variable names start with a lower case character. Where do I find the rules?

          Comment


            #6
            Public ones should be capitalized. Please see the MACD code and pay special attention to what is capitalized and what is not in the Variables and Properties region.
            Josh P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by wzgy0920, 04-20-2024, 06:09 PM
            2 responses
            26 views
            0 likes
            Last Post wzgy0920  
            Started by wzgy0920, 02-22-2024, 01:11 AM
            5 responses
            32 views
            0 likes
            Last Post wzgy0920  
            Started by wzgy0920, 04-23-2024, 09:53 PM
            2 responses
            49 views
            0 likes
            Last Post wzgy0920  
            Started by Kensonprib, 04-28-2021, 10:11 AM
            5 responses
            193 views
            0 likes
            Last Post Hasadafa  
            Started by GussJ, 03-04-2020, 03:11 PM
            11 responses
            3,235 views
            0 likes
            Last Post xiinteractive  
            Working...
            X