Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Tagging the current day h/l

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

    Tagging the current day h/l

    Hello,
    I'm trying to draw a dot at the current High/Low but dot not drawing. Here is my code:
    if (Close[0] == CurrentDayOHL().CurrentHigh[1])
    {
    DrawDot("High" + CurrentBar, true, 0, High[0] + 2, Color.Green);
    }
    if (Close[0] == CurrentDayOHL().CurrentLow[1])
    {
    DrawDot("Low" + CurrentBar, true, 0, Low[0] - 2, Color.Red);
    }
    Any suggestions why this dot won't draw? Thanks

    #2
    Hello CaptainAmericaXX,

    CurrentDayOHL() is only available for the current day and does not use [1] indexing. If you are looking for prior session bars, there are methods:
    PriorDayOHLC()
    GetDayBar()

    What are you trying to express with your code? It looks like it may "Draw Dot when close price equals yesterdays High / Low". Use PriorDayOHLC() for this.
    Last edited by NinjaTrader_RyanM1; 05-16-2011, 02:24 PM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks for reply.
      I'm trying to tag an instance of the current day high/low and take a reverse trade off that high or low. I was simply drawing a dot to make sure I was tagging the instance properly. So far the dot won't draw at the highs or lows.

      Comment


        #4
        I think you're close to this - change the brackets from 0 to 1. You may also want to check Highs and Lows rather than close. It should then indicate when the bar you're looking at made a new high/ low for the day.

        Code:
        if (High[0] == CurrentDayOHL().CurrentHigh[0])
        {
        DrawDot("High" + CurrentBar, true, 0, High[0] + 2, Color.Green); 
        }
        if (Low[0] == CurrentDayOHL().CurrentLow[0])
        {
        DrawDot("Low" + CurrentBar, true, 0, Low[0] - 2, Color.Red); 
        }
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          That did it. Thanks again Ryan!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Hwop38, 05-04-2026, 07:02 PM
          0 responses
          169 views
          0 likes
          Last Post Hwop38
          by Hwop38
           
          Started by CaptainJack, 04-24-2026, 11:07 PM
          0 responses
          324 views
          0 likes
          Last Post CaptainJack  
          Started by Mindset, 04-21-2026, 06:46 AM
          0 responses
          250 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by M4ndoo, 04-20-2026, 05:21 PM
          0 responses
          353 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Started by M4ndoo, 04-19-2026, 05:54 PM
          0 responses
          180 views
          0 likes
          Last Post M4ndoo
          by M4ndoo
           
          Working...
          X