Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Sorting a two dimesional array

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

    Sorting a two dimesional array

    I'm restoring my indicators from a backup after a computer wipeout.

    There are (2) arrays of doubles: sortedLevels[,] and _levels[,] .

    The following line of code doesn't compile anymore... it used to!

    Code:
    sortedLevels=_levels.OrderBy(x => x[1]);
    The Ninjascript editor Intellisense dropdown DOES include the OrderBy method. The indicator does have "using" references to Linq and Collections, Generic.,

    The error message is:

    Double[,] does not contain a definition for OrderBy and no extension method OrderBy accepting first argument type double [,] could be found. Are you missing a directive or an assembly reference?

    Can you please assist? Thank you.

    #2
    Hello Ricam,

    May we have a screenshot of the references window?

    I would expect System.Linq to be available with the System.dll.

    https://stackoverflow.com/questions/...derby/47930641
    https://www.tutorialsteacher.com/art...rray-in-csharp

    Try making a clean install environment, then create a new test script with only that code.
    https://ninjatrader.com/support/foru...683#post783683
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Seems to be fixed. Compiles OK now, but haven't yet checked that the sort is working.

      I pasted this static public class into the MyCustomMethods Add-On, in the Indicator namespace.

      But should it be necessary to do this?

      Comment


        #4
        Hello Ricam,

        This shouldn't be necessary, it sounds like something is missing from your setup

        Did you try a basic test using OrderBy in a clean environment?

        If the clean environment works, do you still see issue after performing a Repair operation with a NinjaTrader installer?

        Please also include a screenshot showing your references in the NinjaScript Editor.

        Update installers may be downloaded here - https://ninjatrader.com/PlatformDirect

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        578 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X