• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Error using List.Min

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

    Error using List.Min

    Hi,

    I have a custom list which contains IOrders, and some other items, I am using the Min method of Lists to find the order whos offer price is the lowest, like this,

    Code:
    var minOffer = offerOrderBook.Min(o => o.Order.LimitPrice);
    this compliles fine but when I try to expose the limit price of the IOrder I get an error. This is how I am trying to get the limit price:-

    Code:
    double f = minOffer.Order.LimitPrice;
    and the error I get is:-

    'double' does not contain a definition for 'Order' and no extension method 'Order' accepting a first argument of type 'double' could be found (are you missing a using directive or an assembly reference?)

    #2
    OK found the problem : )

    The first query actually returns the double I am looking for not the Custom Item. So I am all set.

    Problem solved.

    Comment


      #3
      Hello GKonheiser,

      I am glad you were able to find the solution.

      Thank you for posting your solution.
      Patrick H.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by clairemaclan, Today, 12:48 AM
      0 responses
      5 views
      0 likes
      Last Post clairemaclan  
      Started by Tomass, Yesterday, 11:52 PM
      0 responses
      7 views
      0 likes
      Last Post Tomass
      by Tomass
       
      Started by J_o_s, Yesterday, 11:31 PM
      0 responses
      8 views
      0 likes
      Last Post J_o_s
      by J_o_s
       
      Started by kirkvan, Yesterday, 09:03 PM
      0 responses
      9 views
      0 likes
      Last Post kirkvan
      by kirkvan
       
      Started by hedgeplay, Yesterday, 08:35 PM
      0 responses
      5 views
      0 likes
      Last Post hedgeplay  
      Working...
      X