Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print lists in output in order from highest to lowest

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

    Print lists in output in order from highest to lowest

    Hello NT Team,

    I am creating an indicator that calculates the weighted average of the ATR using different Bar Periods. This Indicator will use the calculated ATR and multiply this number with the Price Fluctuation Dollar Amount respective to their product to rank which products are most volatile in terms of $ amount. The rankings will print in the output window at the beginning of each day. This indicator will use all available futures contracts listed in the commissions pdf file so the rankings will undoubtedly be changing day by day. Are there any examples that you can guide me to that show how to have a list order itself from highest to lowest, or any order for that matter?

    #2
    List<double> SomeList = new List<double>();
    // put some values in
    SomeList.Sort();
    Bruce DeVault
    QuantKey Trading Vendor Services
    NinjaTrader Ecosystem Vendor - QuantKey

    Comment


      #3
      Hello Don22Trader1,

      Thanks for your post.

      The C# Sort() method could be used to sort a list. Note that working with C# Lists would fall under C# education and it is against our policy to provide C# programming education services in our support.

      You may do further research on working with C# Lists by doing a quick Google search for something like "Sort C# Lists highest to lowest" to find information about how to sort a List in C#. Or, you could consider doing a Google search for something like "use C# Sort() method on List"

      This forum thread will also be open for other community members to share their insights and advice on the topic.
      <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      608 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      355 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      560 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      561 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X