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

previous low of the day (not current) in the current day

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

    previous low of the day (not current) in the current day

    previous low of the day (not current) in the current day

    Code:
    double valueHigh = CurrentDayOHL().CurrentHigh[0];
    double valueLow = CurrentDayOHL().CurrentLow[0];
    valueHigh
    valueLow

    these are the current values ​​of the extremums of the day, how to get the past extremum in the current day?

    is there some kind of index in the syntax to get the past value of the extrema?

    like

    valueHigh[1]
    valueLow [1]
    ?

    #2
    Hello memonolog,

    Thanks for your post.

    When you create the variables as a double type IE: double valueHigh you are creating a single instance of a value and you could not use bars ago processing like valueHigh[1] because it is not created as a data series of double types, only as a single instance of a double type.

    To get the value of the prior day, you can use the indicator PriorDayOHLC. Example: PriorDayOHLC().PriorLow[0]
    Reference: https://ninjatrader.com/support/help...r_day_ohlc.htm


    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello memonolog,

      Thanks for your post.

      When you create the variables as a double type IE: double valueHigh you are creating a single instance of a value and you could not use bars ago processing like valueHigh[1] because it is not created as a data series of double types, only as a single instance of a double type.

      To get the value of the prior day, you can use the indicator PriorDayOHLC. Example: PriorDayOHLC().PriorLow[0]
      Reference: https://ninjatrader.com/support/help...r_day_ohlc.htm


      i dont need To get the value of the prior day

      The question is to get the last one during the day
      extremum

      not the current extremum of the day, but the past one during the current day

      Comment


        #4
        Hello memonolog,

        Thanks for your reply.

        If I understand correctly, during the current session you are looking for the value of the in session previous high and low.

        I have attached a screenshot, please confirm if my understanding is correct on what you are looking for,

        If it is not correct, please post a complete screenshot that illustrates what you are looking for.

        Click image for larger version

Name:	memonolog-3.PNG
Views:	291
Size:	35.4 KB
ID:	1143823
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_PaulH View Post
          Hello memonolog,

          Thanks for your reply.

          If I understand correctly, during the current session you are looking for the value of the in session previous high and low.

          I have attached a screenshot, please confirm if my understanding is correct on what you are looking for,

          If it is not correct, please post a complete screenshot that illustrates what you are looking for.

          Click image for larger version

Name:	memonolog-3.PNG
Views:	291
Size:	35.4 KB
ID:	1143823
          Yes, that's what I need

          Comment


            #6
            Hello memonolog,

            Thanks for your reply.

            What you can do is to use the indicator CurrentdayOHL() and check to see if the previous bar[1] is Not equal to the current bar [0]. When that happens it means it just changed to a new value

            For example: if (CurrentDayOHL().CurrentHigh[0] != CurrentDayOHL().CurrentHigh[1])

            When that condition is true, save the previous [1] (CurrentDayOHL().CurrentHigh[1]) to a double variable that will now hold the last previous high.

            Same process for low.






            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ETFVoyageur, Today, 04:00 PM
            1 response
            7 views
            0 likes
            Last Post ETFVoyageur  
            Started by AaronKTradingForum, Today, 03:44 PM
            1 response
            8 views
            0 likes
            Last Post AaronKTradingForum  
            Started by Felix Reichert, 04-26-2024, 02:12 PM
            11 responses
            77 views
            0 likes
            Last Post Felix Reichert  
            Started by junkone, 04-28-2024, 02:19 PM
            7 responses
            83 views
            1 like
            Last Post junkone
            by junkone
             
            Started by pechtri, 06-22-2023, 02:31 AM
            11 responses
            139 views
            0 likes
            Last Post Nyman
            by Nyman
             
            Working...
            X