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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        128 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        73 views
        1 like
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        116 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        109 views
        1 like
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        88 views
        0 likes
        Last Post CarlTrading  
        Working...
        X