Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Pre Market High & Low, and today's opening price indicators?

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

    #16
    Hello MathWiz,

    Thank you for your reply.

    Nope, the only difference would be that you'd see the plot extend to the currently forming bar if it's outside of the premarket time frame.

    Please let us know if we may be of further assistance to you.

    Comment


      #17
      For anyone curious:

      Here is my solution, you need to create a Trading Hours Template (which I call “AH&PM”) that matches the after-hours / pre-market hours for which you seek data.

      This works by putting a thick yellow line 1 bar after the last closing bar on a daily bar chart, but it should work on other charts fine, too, although you may need to play with the Draw.Line formatting [the y start and end values as well as the width of the line).

      Hope this helps!


      else if (State == State.Configure)

      {
      AddDataSeries(Bars.Instrument.FullName, new BarsPeriod() { BarsPeriodType = BarsPeriodType.Minute, Value = 1440 }, "AH&PM");
      }

      . . . then in the OnBarUpdate section:

      Draw.Line(this, "PREMARKET", false, -1, Lows[1][0], -1, Highs[1][0], Brushes.Yellow, DashStyleHelper.Solid, 18);

      Comment


        #18
        Originally posted by NinjaTrader_Kate View Post
        Hello MathWiz,

        Thank you for your reply.

        It would be simplest to just use a single ETH data series that uses time filters to control entry to only enter during RTH hours, so then you could calculate the high/low from the ETH Session open to the current bar when RTH hours start, save those to variables, and then use them as you wish for your entries.

        It is possible to add a secondary series with a different trading hours template to a strategy, but you have to keep in mind mind that: An indicator / strategy with multiple DataSeries of the same instrument will only process realtime OnBarUpdate() calls when a tick occurs in session of the trading hour template of all added series. Any ticks not processed will be queued and processed as a tick comes in for all subsequent DataSeries.

        Please let us know if we may be of further assistance to you.
        Thx for the indicator Kate. If i trade 930Est- 4pm est, do I put those times in if i want to see the overnight highs and lows? Thanks!

        Comment


          #19
          Hello Malletto,

          Yes, the ExampleGetHighLowOfPremarket is applied to the ETH hours trading hours template and uses logic to record the highest high and lowest low from the ETH session start to selected time for the RTHHoursStart and from the RTHHoursEndTime to the actual session end.

          Yes, put in 9:30 AM as the RTHHoursStart and 4:00 PM as the RTHHoursEndTime if you would like these to the intra-session hours.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #20
            Originally posted by NinjaTrader_ChelseaB View Post
            Hello Malletto,

            Yes, the ExampleGetHighLowOfPremarket is applied to the ETH hours trading hours template and uses logic to record the highest high and lowest low from the ETH session start to selected time for the RTHHoursStart and from the RTHHoursEndTime to the actual session end.

            Yes, put in 9:30 AM as the RTHHoursStart and 4:00 PM as the RTHHoursEndTime if you would like these to the intra-session hours.
            What do you mean by intra-session levels? Is that overnight levels?

            Comment


              #21
              Hello Malletto,

              The full ETH hours would be the full session, while the hours of 9:30 AM to 4:00 PM would be intra-session (your custom session in between the full session hours).

              This indicator would be recording the values outside of the custom session for you to use between your custom defined session hours.
              Chelsea B.NinjaTrader Customer Service

              Comment


                #22
                Originally posted by NinjaTrader_ChelseaB View Post
                Hello Malletto,

                The full ETH hours would be the full session, while the hours of 9:30 AM to 4:00 PM would be intra-session (your custom session in between the full session hours).

                This indicator would be recording the values outside of the custom session for you to use between your custom defined session hours.
                got it ok. How would I be able to find the highs/lows from 9:00AM-930AM?

                what are the premarket hours by the way in eastern time for NY session?

                Comment


                  #23
                  Hello Malletto,

                  "How would I be able to find the highs/lows from 9:00AM-930AM?"

                  You could use similar logic to the example where at 9:30 AM (line 76) the session start bar number (9:00) is retrieved with Bars.GetBar() (line 78), and this is supplied to the MAX() indicator as the period (CurrentBar - startBarsAgo + 1) (line 80).

                  "what are the premarket hours by the way in eastern time for NY session?"

                  The hours of an exchange depends on the exchange and the instrument you are trading.

                  For a New York session, this would imply the New York Stock Exchange (NYSE).
                  The US Equities ETH hours are from 8:00 AM Eastern to 8:00 PM Eastern.
                  The US Equities RTH hours are from 9:30 AM Eastern to 4:00 PM Eastern.

                  You can view the trading hours of a trading hours template by clicking Tools > Trading hours > and selecting the trading hours template.
                  Chelsea B.NinjaTrader Customer Service

                  Comment


                    #24
                    Originally posted by NinjaTrader_ChelseaB View Post
                    Hello Malletto,

                    "How would I be able to find the highs/lows from 9:00AM-930AM?"

                    You could use similar logic to the example where at 9:30 AM (line 76) the session start bar number (9:00) is retrieved with Bars.GetBar() (line 78), and this is supplied to the MAX() indicator as the period (CurrentBar - startBarsAgo + 1) (line 80).

                    "what are the premarket hours by the way in eastern time for NY session?"

                    The hours of an exchange depends on the exchange and the instrument you are trading.

                    For a New York session, this would imply the New York Stock Exchange (NYSE).
                    The US Equities ETH hours are from 8:00 AM Eastern to 8:00 PM Eastern.
                    The US Equities RTH hours are from 9:30 AM Eastern to 4:00 PM Eastern.

                    You can view the trading hours of a trading hours template by clicking Tools > Trading hours > and selecting the trading hours template.
                    is there a way to show the levels from other days?


                    Comment


                      #25
                      Hello Malletto,

                      Yes, this would be possible.

                      The MAX() indicator is using [0] barsAgo to get the value from the current bar.

                      You could get the bar number from a previous day and use this as the barsAgo index.

                      For example if I wanted the previous session from session open to 9:30:

                      Code:
                      sessionIterator.GetNextSession(Time[0], true);
                      // check there is a previous session
                      if (Bars.GetBar(sessionIterator.ActualSessionBegin) > 0)
                      {
                          // get the previous session start datetime
                          sessionIterator.GetNextSession(Bars.GetTime(Bars.GetBar(sessionIterator.ActualSessionBegin) - 1), true);
                          beginTime = sessionIterator.ActualSessionBegin;
                      }​
                      int startBarsAgo = CurrentBar - Bars.GetBar(beginTime);
                      int endBarsAgo = CurrentBar - Bars.GetBar(new DateTime(beginTime.Year, beginTime.Month, beginTime.Day, 9, 30, 0));
                      double highestHigh = MAX(High, startBarsAgo)[endBarsAgo];​
                      Chelsea B.NinjaTrader Customer Service

                      Comment


                        #26
                        Originally posted by NinjaTrader_ChelseaB View Post
                        Hello Malletto,

                        Yes, this would be possible.

                        The MAX() indicator is using [0] barsAgo to get the value from the current bar.

                        You could get the bar number from a previous day and use this as the barsAgo index.

                        For example if I wanted the previous session from session open to 9:30:

                        Code:
                        sessionIterator.GetNextSession(Time[0], true);
                        // check there is a previous session
                        if (Bars.GetBar(sessionIterator.ActualSessionBegin) > 0)
                        {
                        // get the previous session start datetime
                        sessionIterator.GetNextSession(Bars.GetTime(Bars.GetBar(sessionIterator.ActualSessionBegin) - 1), true);
                        beginTime = sessionIterator.ActualSessionBegin;
                        }​
                        int startBarsAgo = CurrentBar - Bars.GetBar(beginTime);
                        int endBarsAgo = CurrentBar - Bars.GetBar(new DateTime(beginTime.Year, beginTime.Month, beginTime.Day, 9, 30, 0));
                        double highestHigh = MAX(High, startBarsAgo)[endBarsAgo];​

                        can you update the current zip file with this?

                        are you also able to make an indicator that shows london, Tokyo and NY session highs/lows for each? That would be so so awesome. Thanks so much!

                        Comment


                          #27
                          Hello Malletto,

                          The example is meant to show you how to do it, so that you are able to do this yourself in your own code.

                          Unfortunately, in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services or one on one educational support in our NinjaScript Support department. This is so that we can maintain a high level of service for all of our clients as well as our associates.

                          Through email or on the forum we are happy to answer any specific questions you may have about NinjaScript if you decide to code this yourself. We are also happy to assist with finding resources in our help guide as well as simple examples, and we are happy to assist with guiding you through the debugging process to assist you with understanding unexpected behavior.

                          You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.​
                          Chelsea B.NinjaTrader Customer Service

                          Comment


                            #28
                            Originally posted by NinjaTrader_ChelseaB View Post
                            Hello Malletto,

                            The example is meant to show you how to do it, so that you are able to do this yourself in your own code.

                            Unfortunately, in the support department at NinjaTrader it is against our policy to create, debug, or modify, code or logic for our clients. Further, we do not provide C# programming education services or one on one educational support in our NinjaScript Support department. This is so that we can maintain a high level of service for all of our clients as well as our associates.

                            Through email or on the forum we are happy to answer any specific questions you may have about NinjaScript if you decide to code this yourself. We are also happy to assist with finding resources in our help guide as well as simple examples, and we are happy to assist with guiding you through the debugging process to assist you with understanding unexpected behavior.

                            You can also contact a professional NinjaScript Consultant who would be eager to create or modify this script at your request or assist you with your script. The NinjaTrader Ecosystem has affiliate contacts who provide educational as well as consulting services. Please let me know if you would like a list of affiliate consultants who would be happy to create this script or any others at your request or provide one on one educational services.​

                            ok. Through this indicator then, can you tell me how i can make it show the london, Tokyo, and ny highs and lows. I know I’ll have to use 3 seperate indicators. But can you tell me what time to put for each in est. thanks!

                            Comment


                              #29
                              Hello Malletto,

                              You could add 13 hours to the date time with <DateTime>.AddHours() for the 13 hour difference from new york to tokyo.

                              If you want to convert to a time zone using code this would require advanced c# (not documented in the help guide).

                              This forum post provides sample code provided by another forum user.



                              There wouldn't be any reason you would have to use 3 different indicators, but you could do so if you wanted.
                              Chelsea B.NinjaTrader Customer Service

                              Comment


                                #30
                                Originally posted by NinjaTrader_ChelseaB View Post
                                Hello Malletto,

                                You could add 13 hours to the date time with <DateTime>.AddHours() for the 13 hour difference from new york to tokyo.

                                If you want to convert to a time zone using code this would require advanced c# (not documented in the help guide).

                                This forum post provides sample code provided by another forum user.



                                There wouldn't be any reason you would have to use 3 different indicators, but you could do so if you wanted.
                                But how do i show all 3 sessions on one indicator?

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                                0 responses
                                596 views
                                0 likes
                                Last Post Geovanny Suaza  
                                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                                0 responses
                                343 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by Mindset, 02-09-2026, 11:44 AM
                                0 responses
                                103 views
                                0 likes
                                Last Post Mindset
                                by Mindset
                                 
                                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                                0 responses
                                556 views
                                1 like
                                Last Post Geovanny Suaza  
                                Started by RFrosty, 01-28-2026, 06:49 PM
                                0 responses
                                554 views
                                1 like
                                Last Post RFrosty
                                by RFrosty
                                 
                                Working...
                                X