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

IOrder in a dictionary

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

    IOrder in a dictionary

    I'm trying to store my IOrder objects in a dictionary like this:

    var dictionary = new Dictionary<IOrder, int>();

    but I get the error that a Dictionary requires 2 'type' arguments. Is there a way to store IOrders in a dictionary? Thanks.

    #2
    Radical,

    This is beyond the scope we could fully support, however I'm not having any trouble getting this to compile using System.Collections.Generic;

    What declarations are you using?

    edit: Also is this from an indicator, or a strategy?
    MatthewNinjaTrader Product Management

    Comment


      #3
      Thanks Matthew, I realized the way I had it written in my code was different than the way I wrote it in my post here. I had it like this:

      Dictionary dictionary = new Dictionary<IOrder, int>();

      and changed it to this:

      var dictionary = new Dictionary<IOrder, int>();

      and it works now. Thanks again.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Rogers101, Today, 11:30 AM
      0 responses
      10 views
      0 likes
      Last Post Rogers101  
      Started by MGHORBEL, Today, 11:16 AM
      0 responses
      5 views
      0 likes
      Last Post MGHORBEL  
      Started by michi08, Today, 08:51 AM
      2 responses
      14 views
      0 likes
      Last Post michi08
      by michi08
       
      Started by flybuzz, Today, 10:33 AM
      0 responses
      7 views
      0 likes
      Last Post flybuzz
      by flybuzz
       
      Started by algospoke, 02-19-2024, 03:25 PM
      6 responses
      42 views
      0 likes
      Last Post Abiodun
      by Abiodun
       
      Working...
      X