Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Ambiguous reference between NinjaTrader.Cbi and NinjaTrader.CQG.ProtoBuf ?

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

    Ambiguous reference between NinjaTrader.Cbi and NinjaTrader.CQG.ProtoBuf ?

    I have noticed that I cannot have NinjaTrader.CQG.Protobuf in my using declarations or else it gives ambiguity errors about Account and Order. But if I dont use the CQG, things do not work on CQG connections. How do I get around this? Attached it screenshot showing things.
    Attached Files

    #2
    Answer is obvious, right?

    I mean, when you want the compiler to see an NT Account,
    and be guaranteed that it sees an NT Account and no other,
    then use the full qualified type name for an NT Account,
    which is NinjaTrader.Cbi.Account.

    Same with an NT Order.

    -=o=-

    Using fully qualified names guarantees the exact type
    is being referenced -- sometimes, a FQN is absolutely
    required to resolve ambiguities due to conflicting type
    names within the namespaces.

    You can't do anything about the choice of type names,
    those are chosen by the original programmers, so just
    use the FQN and move on.

    Such is the life of a programmer ...

    Comment


      #3
      Or, you can try using a type alias.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Brillo, Today, 10:35 AM
      0 responses
      1 view
      0 likes
      Last Post Brillo
      by Brillo
       
      Started by Irukandji, 05-06-2024, 03:06 PM
      3 responses
      27 views
      0 likes
      Last Post NinjaTrader_Kimberly  
      Started by RamiRK86, 05-06-2024, 08:05 AM
      2 responses
      32 views
      0 likes
      Last Post RamiRK86  
      Started by synthhokie, Today, 09:24 AM
      1 response
      21 views
      0 likes
      Last Post NinjaTrader_BrandonH  
      Started by sofortune, Yesterday, 09:49 PM
      4 responses
      17 views
      0 likes
      Last Post NinjaTrader_Gaby  
      Working...
      X