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

Intraday bar number. Yesterday's Low while today is still forming.

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

    Intraday bar number. Yesterday's Low while today is still forming.

    Does anyone know if there is a way to find intraday bar number if in a minutely time frame?

    I am trying to reference the Low of the day just passed while still in the current day, in a minutely time frame

    #2
    Hello johnls101,

    Thanks for your post.

    To obtain the prior days low value, you can use PriorDayOHLC().PriorLow[0] which will return the prior days low value until the current day completes. (PriorHigh, PriorOpen and PriorClose are also similarly available).
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thanks so much Paul. That is great.

      Is there any good way to access the last bar of the previous day and the first bar of today (still forming) in the minutely time frame? So far I have used , for example,
      Bla.Set(indicator[barsSinceSession+1]), for the last bar of the previous day
      ... but it looks messy and is probably fairly heavy on processing

      Comment


        #4
        Hello johnls101,

        Thanks for your post.

        You can use:

        if (Bars.FirstBarOfSession) // true only on first bar of the session
        {
        // do something on first bar like access Close[0]
        // and can also access the previous bar which would have been the last bar of the previous session, Close[1]
        }

        Reference: http://ninjatrader.com/support/helpG...rofsession.htm
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thanks Paul. That is very helpful.

          John

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by DJ888, Today, 10:57 PM
          0 responses
          6 views
          0 likes
          Last Post DJ888
          by DJ888
           
          Started by MacDad, 02-25-2024, 11:48 PM
          7 responses
          158 views
          0 likes
          Last Post loganjarosz123  
          Started by Belfortbucks, Today, 09:29 PM
          0 responses
          7 views
          0 likes
          Last Post Belfortbucks  
          Started by zstheorist, Today, 07:52 PM
          0 responses
          7 views
          0 likes
          Last Post zstheorist  
          Started by pmachiraju, 11-01-2023, 04:46 AM
          8 responses
          151 views
          0 likes
          Last Post rehmans
          by rehmans
           
          Working...
          X