Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Advice on namespace usage

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

    Advice on namespace usage

    Hi

    I have a question for any of the forum's experienced programmers about good practice regarding the use of namespaces.

    I have written a class for use in my strategies, which I have put in a separate file. The class is defined in namespace NinjaTrader.Strategy and is available to all my strategy files.

    I now want to use that class in an indicator, but it is not available within my indicator file.

    My quick solution is to add
    "using NinjaTrader.Strategy" in the Using declarations section of my indicator file.

    Is this good practice, or should I define the class in namespace NinjaTrader.Indicator as well?

    Is there a better way?

    Cheers
    Tony

    #2
    Tony, don't see a concern here - having only one location is easier for updates and management of the 'collection'.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    627 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    359 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    105 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    562 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    567 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X