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

Indicator Namespace How Does It Work

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

    Indicator Namespace How Does It Work

    If You = NT Staff, stop reading. You shouldn't use up your time answering this sort of question.... I understand C# is not supported here.

    I've recently been trying to learn C# up to a level where I will feel comfortable coding Ninjascripts.

    One exercise has been to look at the auto-generated code in ninjascript editor to learn.

    Consider picture below. I'm wondering how the Ninjatrader.Indicator namespace is able to put together all the indicators used in Ninjatrader without having some sort of equilvalent of the "Partial" keyword that is sometimes used for a class where the class is defined in multiple files. In this example, my stupid "If Open=Close indicator" is the only indicator here. So just wondering from a programming perspective how C# knows to compile all the different indicators into the same Ninjatrader.Indicator namespace.

    And yes I know this is nit-picky but I'm trying to understand and process all this stuff.

    Attached Files
    Last edited by geoMEAN; 04-19-2008, 04:46 AM. Reason: typo

    #2
    >> If You = NT Staff, stop reading
    Done

    Comment


      #3
      Dierk, well at least you follow instructions!

      Perhaps I'll elicit a quick response from a programmer if I refrase in shorter language:

      Can the same namespace be defined across multiple .cs files?

      E.g.:
      //in file SMA.cs
      namespace NinjaTrader.Indicator
      {
      public class SMA : Indicator
      {
      }
      }
      //in file EMA.cs
      namespace NinjaTrader.Indicator
      {
      public class EMA : Indicator
      {
      }
      }

      I imagine this is what is happening each time I create a new indicator as I've heard that all strats are kept in 1 compiled strat file and all indicators kept in 1 compiled indicator file.

      Comment


        #4
        >> Can the same namespace be defined across multiple .cs files?
        That's how all NS files work.

        Comment


          #5
          Originally posted by geoMEAN View Post

          I imagine this is what is happening each time I create a new indicator as I've heard that all strats are kept in 1 compiled strat file and all indicators kept in 1 compiled indicator file.
          This explains why if we mess up one strategy, no other strategy works until we fix the one that has the issue. Or why if we forget a reference in one file and take away the dll and then the strat that used it, we still have errors in other strats until the reference is GLOBALLY removed... I think...
          Last edited by TakisTakis; 07-17-2010, 08:13 AM.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by judysamnt7, 03-13-2023, 09:11 AM
          4 responses
          59 views
          0 likes
          Last Post DynamicTest  
          Started by ScottWalsh, Today, 06:52 PM
          4 responses
          36 views
          0 likes
          Last Post ScottWalsh  
          Started by olisav57, Today, 07:39 PM
          0 responses
          7 views
          0 likes
          Last Post olisav57  
          Started by trilliantrader, Today, 03:01 PM
          2 responses
          22 views
          0 likes
          Last Post helpwanted  
          Started by cre8able, Today, 07:24 PM
          0 responses
          10 views
          0 likes
          Last Post cre8able  
          Working...
          X