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 CarlTrading, 03-31-2026, 09:41 PM
      1 response
      77 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      53 views
      0 likes
      Last Post CarlTrading  
      Working...
      X