Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Vertical Time Lines
Collapse
X
-
Vertical Time Lines
Hi, is there a way to draw vertical lines at a specific time on non-time based charts?Tags: None
-
Hello shildebrand324,
If there is not a bar with that specific time on the chart then the answer would be no. You can use specific times with drawing objects for their anchors however if the bar time is not a bar on the chart the object won't appear as expected. It would appear on a time which is near the time you used. Drawing is linked to the bars on the chart so any time you use would need to exist to be accurately drawn on a specific bar.
Generally if you are using a non time based chart you would need to do ranges of times instead of specific times to ensure something happens around the given time. For example if you wanted something to be drawn at 8:00 you would need to first figure out how frequent bars are generated and get their time stamps. If we assume bars are generated frequently like 3 bars every minute you could make a condition that checks if the time is greater equal to 8:00 and lesser equal to 8:01 to make sure at least one of those bars is used for drawing.
In realtime you can also use the OnMarketData override to get the tick times which would help give more accurate times for doing conditions. Another option would be to add a tick series or a time based series as a secondary series to be used for time conditions which would let you get specific times.Last edited by NinjaTrader_Jesse; 03-16-2023, 07:32 AM.
-
Thank you for the response...
I used the range option, and sometimes they can be off my as much as 30-45 seconds. I'm using a range chart.
Even if I used a secondary series, if I tried to draw a line that's not on the range bar, would the script fail?
I've added a 1 minute data series, but it doesn't seem to capture the correct times.
Comment
-
Hello shildebrand324,
The script wouldnt fail but as mentioned the drawing won't appear on a bar that doesn't exist. If the 8:00 bar is not on the chart and you are using that time then the drawing won't appear in-between bars, it would be drawn on a bar that is near that time that actually exists on the chart. Adding a secondary series would just give you the option to have specific bar times to execute logic where the range bars won't have specific times to execute logic because that's based on price movement. Drawing is always going to relate to the primary bars on the range chart.
Comment
-
Comment
-
-
Hello shildebrand324,
The script can but you would be limited to drawing based on the primary bars from the range series. For the drawing object to draw on a specific time you would need to draw it from a time based chart. If a seperate chart that is a 1 minute chart draws a global object that object could be at a specific time in intervals of 1 minute. That object would show on other charts that are not time based.
Comment
-
What I'm trying to determine, can the script run on a 1 minute chart, marking the lines as global, and they show up on my range chart?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
571 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
330 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
549 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
549 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment