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

Daily High / Low

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

    Daily High / Low

    Hello

    I'd like to find out what's the easiest way to check whether the current (or any prior) candle has made a new daily high / low.

    Thanks a lot for any suggestions.

    #2
    Hello laocoon,
    You can use the CurrentDayOHL function to determine it. A sample code will be like

    Code:
    if (this.CurrentDayOHL().CurrentHigh[0] > this.CurrentDayOHL().CurrentHigh[1])
    {
    	//do something
    }
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Hello Joydeep,

      Thanks a lot for your reply. That's exactly what I was looking for!

      Thanks again & Regards

      Comment


        #4
        Hello Joydeep,

        I've got a quick follow-up question regarding the Daily High / Low issue:

        How can you make sure that the Current Daily High / Low is a FRESH High / Low, ie not one that has already been reached earlier in the session?

        Example:
        The market makes a Daily High of 977 at 10 AM. It then retreats and hits the 977 level again at 1PM.
        The "this.CurrentDayOHL().CurrentHigh[0]" function will return 977 although it is not a FRESH New Daily High. How can I make sure that this doesn't happen, ie the value should only be returned if it is FRESH (never reached before)?

        Thanks a lot for your reply.

        Comment


          #5
          Hello laocoon,
          The below code itself as i demonstrated earlier should do it.

          Code:
          if (this.CurrentDayOHL().CurrentHigh[0] > this.CurrentDayOHL().CurrentHigh[1])
          {
          	//do something
          }
          JoydeepNinjaTrader Customer Service

          Comment


            #6
            Hello Joydeep,

            That does it indeed, almost too easy!

            Thanks again & have a nice evening.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by pmachiraju, 11-01-2023, 04:46 AM
            8 responses
            148 views
            0 likes
            Last Post rehmans
            by rehmans
             
            Started by mattbsea, Today, 05:44 PM
            0 responses
            5 views
            0 likes
            Last Post mattbsea  
            Started by RideMe, 04-07-2024, 04:54 PM
            6 responses
            33 views
            0 likes
            Last Post RideMe
            by RideMe
             
            Started by tkaboris, Today, 05:13 PM
            0 responses
            5 views
            0 likes
            Last Post tkaboris  
            Started by GussJ, 03-04-2020, 03:11 PM
            16 responses
            3,282 views
            0 likes
            Last Post Leafcutter  
            Working...
            X