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

Get Maximum of series

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

    Get Maximum of series

    Hi everybody
    How can i get maximum value of a special series (for example ZN 5 years), in a special period.
    Then i want to determine where the input is greater than this maximum for 3 ticks (for example)

    #2
    Hello amiralimadadi,

    Thank you for your note.

    You could pass the Ten Year series to the MAX method, which will return the highest value in that series.

    See,



    If you wanted to get the MAX value of the previous 20 bars, starting from 100 bars ago, you specify the int BarsAgo, for example,

    Code:
    MAX(High, 20)[100];
    The helpguide shows how to save this value to a double variable, which you could then use to check against the close on the current bar, ie Close[0]+3*TickSize to check if the current close is greater.

    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Hello gplatis,

      Yes, NT7 has the max method as well.


      Please let us know if you need further assistance.
      Alan P.NinjaTrader Customer Service

      Comment


        #4
        Thanks. It was so helpful. but i need max value in a special time period. for example from 7:20 to 8:20 us central time.

        Comment


          #5
          Hello amiralimadadi,

          Thanks for your reply.

          In that case, we recommend that you set a time condition to test for the 8:20 period and when true to then search for the MAX as previously advised with a period look back that would cover the start time of 7:20. For example (using 1 minute bars):

          if (ToTime(Time[0]) == 082000)
          {
          todaysHigh = MAX(High, 60)[0]; //look back 1 hour
          }
          Paul H.NinjaTrader Customer Service

          Comment


            #6
            Thanks
            I would like to know how to convert between time zones in ninja. i want to do this for a special time zone.
            for example "central standard time". i want to convert local time to this time zone then get maximum in the period of 7:20 to 8:20

            Comment


              #7
              Hello amiralimadadi,

              Thanks for your reply.

              Please review the helpguide section here:

              https://ninjatrader.com/support/help...oniterator.htm This shows all of the method and properties available to use.

              https://ninjatrader.com/support/help...beginlocal.htm this shows an example of getting the exchange trading time and adjusting to the local PC time
              Paul H.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by CortexZenUSA, Today, 12:53 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by CortexZenUSA, Today, 12:46 AM
              0 responses
              1 view
              0 likes
              Last Post CortexZenUSA  
              Started by usazencortex, Today, 12:43 AM
              0 responses
              5 views
              0 likes
              Last Post usazencortex  
              Started by sidlercom80, 10-28-2023, 08:49 AM
              168 responses
              2,265 views
              0 likes
              Last Post sidlercom80  
              Started by Barry Milan, Yesterday, 10:35 PM
              3 responses
              11 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Working...
              X