Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Easiest way to organize variables largest to smallest

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

    Easiest way to organize variables largest to smallest

    I have 10 variables I need organized from largest to smallest. What the easiest way I could do it without writing each scenario?

    #2
    Hello Tmaninc,

    Thanks for your post.

    "Easiest" may be a matter of subjectivity.

    This is more of a C# question as there are no ninja script methods or properties that provide a sorting function.

    However, one C# .net approach would be to create a list, assign the variable values to an element in the list and use the List.Sort method which would resequence the list from lowest to highest.

    Non NinjaTrader Reference: https://www.dotnetperls.com/sort

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    56 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    133 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X