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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        49 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        141 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        160 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        96 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        275 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X