Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

yesterday's OHLC when using one minute bars?

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

    yesterday's OHLC when using one minute bars?

    Can I calculate yesterday's OHLC when using one minute bars with the intention of using those values for today's 24 hour calcs? If so, how?

    Am I a senior member now because I am subscribing to real time data?

    #2
    Hello joemiller,

    Thank you for your post.

    You can use GetDayBar() to pull the previous session's OHLC. For information on GetDayBar() please visit the following link: http://www.ninjatrader.com/support/h.../getdaybar.htm

    The Senior Member is not based on your data feed provider or License Key, it should be based on your Join Date and Posts count.

    Please let me know if I may be of further assistance.

    Comment


      #3
      where is output window?

      the GetDayBar() function userguide example refers to an output window. how do I display the output window?

      Comment


        #4
        please ignore the previous reply asking 'how do I open the output window?'

        please ignore the previous reply asking 'how do I open the output window?'

        I have found out how to do it.

        Comment


          #5
          last bar of a session?

          I want to write to the output window on the last bar of a session. I have found a FirstBarOfSession function in the user guide but cannot find a LastBarOfSession function.

          such a capability must be out there somewhere...please advise.

          Comment


            #6
            LastBarOfSession??????

            A search for LastBarOfSession in the Userguide results in 'No results found.' The same search on this Forum is productive! So for now I will use the Forum search hits as my reference resource if I have a problem trying to resolve my issue.

            Comment


              #7
              final day or bar of a strategy analysis?

              I need a function that tells me when I am on the final day or bar of a strategy analysis.

              I have discovered that I don't want LastBarOfSession. instead I need something like maybe OnTermination().

              I will continue to experiment. In the meantime any suggestions/insights will be much appreciated.

              Comment


                #8
                Hello,

                OnTermination will only be called when you turn off the strategy.

                If you want to know if you're on the last bar of the strategy, you can use the Count function to count the number of bars on the chart/strategy:



                Then you can compare your CurrentBar to your Count variable and that should let you know when you're on the final bar.

                I'm including a link to our Alphabetical Reference list to help you find some functions you were not able to search for:

                MatthewNinjaTrader Product Management

                Comment


                  #9

                  I have defined count in the variables region as: publicint count;

                  I have the following 'if' statement in the
                  OnBarUpdate r
                  egion:

                  if (CurrentBar == Count) //jm count is total number of bars.
                  Print(" 'if (CurrentBar == Count)' TEST MSG");

                  nothing appears in the output window

                  maybe I need to initialize 'count' but I have not been able to?

                  the strategy code is attached.

                  please advise.
                  Attached Files

                  Comment


                    #10
                    You'd actually want to check if the CurrentBar was equal to Count-1 as Count might have extra bars as the ticks come in.

                    Code:
                    		if (CurrentBar == Count - 1) //jm count is total number of bars.
                    				Print(" 'if (CurrentBar == Count)' TEST MSG");
                    MatthewNinjaTrader Product Management

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                    0 responses
                    633 views
                    0 likes
                    Last Post Geovanny Suaza  
                    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                    0 responses
                    364 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by Mindset, 02-09-2026, 11:44 AM
                    0 responses
                    105 views
                    0 likes
                    Last Post Mindset
                    by Mindset
                     
                    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                    0 responses
                    567 views
                    1 like
                    Last Post Geovanny Suaza  
                    Started by RFrosty, 01-28-2026, 06:49 PM
                    0 responses
                    568 views
                    1 like
                    Last Post RFrosty
                    by RFrosty
                     
                    Working...
                    X