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.
    JesseNinjaTrader Customer Service

    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 geotrades1, Today, 10:02 AM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by ender_wiggum, Today, 09:50 AM
      1 response
      5 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Started by rajendrasubedi2023, Today, 09:50 AM
      1 response
      12 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by bmartz, Today, 09:30 AM
      1 response
      9 views
      0 likes
      Last Post NinjaTrader_Erick  
      Started by geddyisodin, Today, 05:20 AM
      3 responses
      26 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X