Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Missing custom "using" declaration

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

    Missing custom "using" declaration

    Hello!
    When I create the indicator, I also create the custom namespace in the same file
    Code:
    using ......
    using myNameSpace;
    
    namespace NinjaTrader.NinjaScript.Indicators
    {
          public class MyIndicator: Indicator
          {
           .....
    
                 [NinjaScriptProperty]
                public myCustomType PropertyName
                 {
                      get;
                       set;
                  }
           }
    }
    
    namespace myNameSpace
    {
    
        public myCustomType
        {
             ......
         }
    }
    when I export my indicator as compiled assembly I can't find my using declaration in *.cs file within the *.zip file. So, when I try to import my indicator on other computer I get an error: "Can't find type myCustomType. Are you missing the custom assembly reference?".
    When I type in this using declaration manualy, ninja successfuly imports the indicator and everything works fine.

    #2
    Hello,

    Thank you for the question.

    In general with compiled assemblies, if you are using another namespace it would be best to use the fully qualified type name rather than a using statement to ensure everything links up.

    for example rather than using the using statement, have you tried:

    myNameSpace.myCustomType

    This would likely resolve the problem, this mainly happens when using enums in a custom namespace and not using the fully qualified name.

    If that does not correct the problem, could you attach a simplified example that demonstrates this that we could work with?

    I look forward to being of further assistance.

    Comment


      #3
      Originally posted by serialbug View Post
      Hello!
      When I create the indicator, I also create the custom namespace in the same file
      Code:
      using ......
      using myNameSpace;
      
      namespace NinjaTrader.NinjaScript.Indicators
      {
            public class MyIndicator: Indicator
            {
             .....
      
                   [NinjaScriptProperty]
                  public myCustomType PropertyName
                   {
                        get;
                         set;
                    }
             }
      }
      
      namespace myNameSpace
      {
      
          public myCustomType
          {
               ......
           }
      }
      when I export my indicator as compiled assembly I can't find my using declaration in *.cs file within the *.zip file. So, when I try to import my indicator on other computer I get an error: "Can't find type myCustomType. Are you missing the custom assembly reference?".
      When I type in this using declaration manualy, ninja successfuly imports the indicator and everything works fine.
      ref: http://ninjatrader.com/support/forum...74&postcount=9

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      657 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      373 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      109 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      574 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      579 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X