Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

New Hour LINE Indicator

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

    New Hour LINE Indicator

    Hey guys, quick question why does this code Not work

    Code:
    //If Current Bar's Hour is Greater than Previous Bar's Hour, Draw New Line
    			if(Time[0].Hour > Time[1].Hour)
    			DrawVerticalLine("New Hour" + CurrentBar, 0, Color.Yellow, DashStyle.Dot, 2);

    #2
    Hello ginx10k,

    Thanks for your post.

    I suspect that unless you have a check for current bars that the indicator is likely erroring out when you run it. On the very first bar of data that the indicator will process the code would check the previous bar[1] when there is no previous bar. Adding: if(CurrentBar < 1) return; allows the code to run, see attached.

    Reference:
    Attached Files

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    559 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    324 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    546 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    547 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X