Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What is: using NinjaTrader.CQG.ProtoBuf?

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

    What is: using NinjaTrader.CQG.ProtoBuf?

    Hello,

    I'm coding a strategy (Visual Studio Editor) and more times was occurring an error, today just when I was adding a simple code line (private Order tradeOrder = null;).

    CS0104 'Order' is an ambiguous reference between 'NinjaTrader.Cbi.Order' and 'NinjaTrader.CQG.ProtoBuf.Order'

    The editor was adding alone a Using declaration: using NinjaTrader.CQG.ProtoBuf;

    Could you tell me why this occurs, exactly what is NinjaTrader.CQG.ProtoBuf​ and if is better to use it with CQG?

    Please note that cancelling the declaration: using NinjaTrader.CQG.ProtoBuf;​ all back to work fine with no errors.

    Many thanks. Regards


    #2
    Hello ClauTrade,

    NinjaTrader.CQG.ProtoBuf.Order is part of the connection adapter for CQG/Continuum connections.

    The NinjaTrader.Cbi.Order is what should be used in your script.

    VisualStudio is likely automatically adding using directives by guessing you will need it when typing a class name also used in other namespaces.
    Learn how to use the Quick Actions and Refactorings menu to immediately add the necessary imports or using directives for copy-and-pasted code.

    I am using Visual Studio with Unity. When I copy and paste a code in Visual Studio. It automatically adds an unnecessary namespace on the top. It is pretty annoying to see if there have many unused


    Note, the NinjaScript Editor does not do this.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello Chelsea,

      yes, I supposed it was something from Visual Studio ... ok, I will stay using NinjaTrader.Cbi.Order and I will follow your suggest to avoid automatic adding.

      many thanks for support!

      Have nice day!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      46 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      126 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      66 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X