Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Box and Color Session Times w/ Height = High and Low of Session

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

    Box and Color Session Times w/ Height = High and Low of Session

    Hello--

    Does anyone know how I might code an indicator that would place a box around the bars within a session, with the left side of the box being equal to the session start time, the right side of the box being the current time of the session end time, the top of the box being the session high and the bottom of the box being the session low? I would then like to color the box with an opacity.

    Thanks for your help. I REALLY appreciate it.

    All best,

    Aventeren

    #2
    Hello Aventeren,

    Thank you for your post.

    The box will be drawn with the DrawRectangle() method, you will want to use the DateTime syntax listed at the following link: http://www.ninjatrader.com/support/h...wrectangle.htm
    For the session begin and end times you will need to use Bars.Session.GetNextBeginEnd() method: http://www.ninjatrader.com/support/h...xtbeginend.htm

    Please let me know if you have any questions.

    Comment


      #3
      Perfect; thanks.

      One other question, if I wanted to draw the size of the range (range high - range low) just underneath the range low, what are my Draw Text options and which text option do you like to use?

      Thanks,

      Aventeren

      Comment


        #4
        Hello Aventeren,

        You can use DrawText() and specify the Y value and where you will place the text.
        DrawText("myText" + CurrentBar, "Text that needs to be drawn", BarsAgo, Y-Value, Color)

        http://www.ninjatrader.com/support/h...l?drawtext.htm
        Cal H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        118 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        166 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        85 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        130 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        88 views
        0 likes
        Last Post PaulMohn  
        Working...
        X