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

Start/End of day plot

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

    Start/End of day plot

    Hi, does anyone know how to program an indicator that plots the day's trading period from open till close on 24 hour data chart?

    #2
    Could you please elaborate on what you mean exactly. By default it will plot all of the days data. This means if data starts coming in at midnight (00:00) it will start plotting there and if the data ends for the day in 24 hrs (24:00) it will stop that days data there and start a new days data at 00:00. Does that make sense?

    By default it will not truncate any of the data from being displayed.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      What I meant is I need a way to mark the day's session in a 24 hour data chart.
      If I set up a 24 hour chart, the day's break happens as 12:00am. I need to also mark the 9:30am to 4:15pm period.

      Thanks,

      Pablo

      Comment


        #4
        Perhaps what you could do is something like this
        Code:
        if (ToTime(Time[0]) == 93000 || ToTime(Time[0]) == 161500)
             DrawVerticalLine("Market Session" + CurrentBar, 0, Color.Black, DashStyle.Dash, 2);
        http://www.ninjatrader-support.com/H...V6/ToTime.html

        Josh P.NinjaTrader Customer Service

        Comment


          #5
          NT 6.5 due out shortly supports sessions that span across midnight and will mark the "session break" and not "day break" like the current production version of NinjaTrader.
          RayNinjaTrader Customer Service

          Comment


            #6
            Great to know Ray, thanks!

            Comment


              #7
              You might try my TimeScale indicator, which displays the time and date by a red vertical line every hour, and gives the screen a slight background tint during trading hours.

              I hadn't posted this before because it needs work for certain intervals. But here it is in case anyone finds it useful.

              I put it up when I'm trying to look over a lot of backtest data and can't find which day is which, and it does that pretty well.

              You might have to turn off the hourly bars, as sometimes they display the times over what you're looking at, and this is done by setting "DateOnly".

              Hope this helps.

              KBJ
              Attached Files

              Comment


                #8
                That worked great, thanks!

                Comment


                  #9
                  Special Request

                  That indicator works very nice...

                  Can you tell me if a red line can be plotted every 30min?

                  thank you

                  Comment


                    #10
                    Sure you can but you will need to program it. Use an incremental time filter to draw a red line in the time intervals you want.
                    Josh P.NinjaTrader Customer Service

                    Comment


                      #11
                      Finally figured it out

                      I know this is an old thread, but for others that are searching: Below is some simple code to draw something at a given time of day, everyday.

                      if (Bars.FirstBarOfSession == true)
                      {
                      DateTime myTime = DateTime.Parse((Time[0]).ToString("d") + " 9:30 AM");
                      DrawVerticalLine("myTime" + CurrentBar, myTime, Color.Blue, DashStyle.Dash, 2);
                      Print(myTime);
                      }

                      Just replace " 9:30 AM" with whatever time you want to draw the object, making sure to include a space before the hour numeral.

                      The print output should look like this: 6/28/2011 9:30:00 AM

                      Comment


                        #12
                        motownlucas,

                        Thanks for sharing!
                        MatthewNinjaTrader Product Management

                        Comment


                          #13
                          Originally posted by motownlucas View Post
                          I know this is an old thread, but for others that are searching: Below is some simple code to draw something at a given time of day, everyday.

                          if (Bars.FirstBarOfSession == true)
                          {
                          DateTime myTime = DateTime.Parse((Time[0]).ToString("d") + " 9:30 AM");
                          DrawVerticalLine("myTime" + CurrentBar, myTime, Color.Blue, DashStyle.Dash, 2);
                          Print(myTime);
                          }

                          Just replace " 9:30 AM" with whatever time you want to draw the object, making sure to include a space before the hour numeral.

                          The print output should look like this: 6/28/2011 9:30:00 AM
                          I want to use 10 AM to draw fibonacci line. In this case would I still leave

                          (Bars.FirstBarOfSession == true) or something different as the IF() statement?

                          Comment


                            #14
                            You could change the time the draw object would be placed at of course, but the timing when this call would be done is tied to the first bar of the session unless you change the if () condition.
                            BertrandNinjaTrader Customer Service

                            Comment


                              #15
                              If you want the drawing to be placed when the session starts, yes.

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by ageeholdings, Today, 07:43 AM
                              0 responses
                              7 views
                              0 likes
                              Last Post ageeholdings  
                              Started by pibrew, Today, 06:37 AM
                              0 responses
                              4 views
                              0 likes
                              Last Post pibrew
                              by pibrew
                               
                              Started by rbeckmann05, Yesterday, 06:48 PM
                              1 response
                              14 views
                              0 likes
                              Last Post bltdavid  
                              Started by llanqui, Today, 03:53 AM
                              0 responses
                              6 views
                              0 likes
                              Last Post llanqui
                              by llanqui
                               
                              Started by burtoninlondon, Today, 12:38 AM
                              0 responses
                              12 views
                              0 likes
                              Last Post burtoninlondon  
                              Working...
                              X