//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);
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
New Hour LINE Indicator
Collapse
X
-
New Hour LINE Indicator
Hey guys, quick question why does this code Not work
Code:Tags: None
-
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:
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
576 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
334 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
101 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
553 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
551 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment