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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    22 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    12 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    8 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    10 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    16 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X