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

maximum and minimum with minimum of 4 data

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

    maximum and minimum with minimum of 4 data

    maximum and minimum with minimum of 4 data try in several ways and I can not get the maximum attached the code for help
    Attached Files

    #2
    Hello TraderElegante,

    Thanks for your post.

    Between the code formatting and what is written in the script, I am not sure what you are trying to do.

    Could you elaborate and explain in plain English what you are trying to accomplish specifically?

    If you want to find the maximum value from a Series, I.E. the Highest High, it would be done like:

    MAX(Series, NumberOfPreviousBarsToInclude)[HowManyBarsAgo]

    I.E.

    MAX(High, 5)[0] would return the highest high of the last five bars, checking from the current bar that is processing.

    MAX(High, 5)[0] would return the highest high of the last five bars, checking from the last bar that was processed.

    MAX - https://ninjatrader.com/support/help...aximum_max.htm

    We look forward to assisting.
    JimNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jim View Post
      Hello TraderElegante,

      Thanks for your post.

      Between the code formatting and what is written in the script, I am not sure what you are trying to do.

      Could you elaborate and explain in plain English what you are trying to accomplish specifically?

      If you want to find the maximum value from a Series, I.E. the Highest High, it would be done like:

      MAX(Series, NumberOfPreviousBarsToInclude)[HowManyBarsAgo]

      I.E.

      MAX(High, 5)[0] would return the highest high of the last five bars, checking from the current bar that is processing.

      MAX(High, 5)[0] would return the highest high of the last five bars, checking from the last bar that was processed.

      MAX - https://ninjatrader.com/support/help...aximum_max.htm

      We look forward to assisting.
      if I did that way but I did graph in the price panel .. I did not want to use the MAX function but to try to do it with code to learn it is that I am new to C # .. the idea is I want to find the maximum ocsilator when it is> 0 , but to calculate the maximum use at least 4 bars.

      Comment


        #4
        Hello TraderElegante,

        Our role is to support our product, not really to teach customers how to program with C#. There are many online resources external to NinjaTrader, including formal programming classes that we would suggest looking into if you are looking for C# education.

        I would suggest MAX/MIN for usage purposes, and to generate code using the Strategy Builder's View Code button after you create a condition using MAX or MIN, so you can see what the syntax looks like when the Strategy Builder generates the code.

        MAX and MIN are also open source. You may reference the source code for these indicators to see how they loop over bars to derive a maximum or minimum with C#.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by SantoshXX, Today, 03:09 AM
        0 responses
        12 views
        0 likes
        Last Post SantoshXX  
        Started by DanielTynera, Today, 01:14 AM
        0 responses
        2 views
        0 likes
        Last Post DanielTynera  
        Started by yertle, 04-18-2024, 08:38 AM
        9 responses
        42 views
        0 likes
        Last Post yertle
        by yertle
         
        Started by techgetgame, Yesterday, 11:42 PM
        0 responses
        14 views
        0 likes
        Last Post techgetgame  
        Started by sephichapdson, Yesterday, 11:36 PM
        0 responses
        2 views
        0 likes
        Last Post sephichapdson  
        Working...
        X