Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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
    Brandon H.NinjaTrader Customer Service

    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.
        Brandon H.NinjaTrader Customer Service

        Comment


          #5
          I think I got it figured out.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by kaywai, Today, 06:26 AM
          0 responses
          1 view
          0 likes
          Last Post kaywai
          by kaywai
           
          Started by kevinenergy, 02-17-2023, 12:42 PM
          118 responses
          2,778 views
          1 like
          Last Post kevinenergy  
          Started by briansaul, Today, 05:31 AM
          0 responses
          9 views
          0 likes
          Last Post briansaul  
          Started by traderqz, Yesterday, 12:06 AM
          11 responses
          28 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by PaulMohn, Today, 03:49 AM
          0 responses
          9 views
          0 likes
          Last Post PaulMohn  
          Working...
          X