Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

The type or namespace name 'Strategy' does not exist

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

    The type or namespace name 'Strategy' does not exist

    The type or namespace name 'Strategy' does not exist in the namespace 'NinjaTrader.NinjaScript' (are you missing an assembly reference?)

    I am getting this one error in a strategy I am working on and can't find anything online to help correct the issue. It is a CS0266 code on line 5. ( using NinjaTrader.NinjaScript.Strategy; // Ensure this is added for Strategy class ) Does anyone have any ideas? This is my first time creating a strategy.

    #2
    Hello terryreeves_,

    Thank you for your post.

    "using NinjaTrader.NinjaScript.Strategy" is not a valid using statement.

    Are you using NinjaTrader 7 or NinjaTrader 8? This is posted in the NinjaTrader 7 section of the forums.

    If you are using NinjaTrader 8 we would recommend simply using the NinjaScript Wizard to generate the correct and necessary code.

    Comment


      #3
      Thank you. I figured it out.

      Comment


        #4
        Originally posted by terryreeves_ View Post
        The type or namespace name 'Strategy' does not exist in the namespace 'NinjaTrader.NinjaScript' (are you missing an assembly reference?)

        I am getting this one error in a strategy I am working on and can't find anything online to help correct the shop now issue. It is a CS0266 code on line 5. ( using NinjaTrader.NinjaScript.Strategy; // Ensure this is added for Strategy class ) Does anyone have any ideas? This is my first time creating a planetpokies strategy.
        I think, you're trying to use NinjaTrader.NinjaScript.Strategy, but that namespace doesn’t exist. In NinjaTrader, strategies are defined under NinjaTrader.NinjaScript.Strategies, not Strategy. Remove using NinjaTrader.NinjaScript.Strategy; and ensure your class properly inherits from StrategyBase. Also, check if you have the correct references added in your project. If you're using NinjaTrader 8, you may need to add using NinjaTrader.NinjaScript; instead.
        What are the necessary references and inheritance requirements for creating a strategy in NinjaTrader 8?
        Last edited by Joeteryse; 02-04-2025, 04:21 AM. Reason: Spell Error

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        547 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        323 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        99 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        543 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        545 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X