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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        63 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        90 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        47 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        105 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        63 views
        0 likes
        Last Post PaulMohn  
        Working...
        X