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 argusthome, 03-08-2026, 10:06 AM
        0 responses
        70 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        42 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        25 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        28 views
        0 likes
        Last Post TheRealMorford  
        Started by Mindset, 02-28-2026, 06:16 AM
        0 responses
        54 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Working...
        X