Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

No data using MIN/MAX

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

    No data using MIN/MAX

    I have a plot (working) however when trying to find min value I get nothing. In the OnBarUpdate I have the following


    Plot0[0] = somePlot(someSeries, somePeriod)[0];

    double value = MIN(Plot0, 150)[0];
    Print(string.Format("Low Volitility Threshold: ", value.ToString()));

    #2
    Hello Itachi,

    Thanks for your post.

    See the attached example script demonstrating getting the minimum value of a plot using the MIN indicator and printing that value to the Output window.

    In the example script, we first assign the SMA indicator value to the plot. After assigning a value to the plot we use MIN() to get the lowest value of the plot for the last 20 bars and assign that value to a private double variable. Then, we print out the double variable to the Output window and we print out the current plot value for comparison.

    See the help guide documentation below for more information.
    MIN: https://ninjatrader.com/support/help...inimum_min.htm

    Let us know if we may assist further.
    Attached Files
    <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


      #3
      I've looked at the sample and have tried using the sample code, but I still can't print the min value from the plot and there is a plot visible.

      Comment


        #4
        Hello Itachi,

        Thanks for your note.

        When you run the previously attached example script on a chart you will see the current plot value (Value) and the minimum value (minVal) printing to a New > NinjaScript Output window.

        This is meant to be a reference sample to give you direction for creating your own indicator. If you do not see your indicator printing out the minimum value of the plot, you would need to take debugging steps to determine how the script is behaving.

        To understand why the script is behaving as it is, it is necessary to add prints to the script that print the values used for the logic of the script to understand how the script is evaluating.

        In the script, add prints (outside of any conditions) that print the values of every variable used in every condition with the time of that bar. Prints will appear in the NinjaScript Output window (New > NinjaScript Output window).

        Below is a link to a forum post that demonstrates how to use prints to understand behavior.
        https://ninjatrader.com/support/foru...121#post791121

        Let us know if we may assist further.
        <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


          #5
          I think I got it figured out.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          648 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          369 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          572 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X