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