Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
DrawLine into the future
Collapse
X
-
DrawLine into the future
To draw a line into the future, one must supply a startTime and a endTime. Most of the time, for the first DrawLine, Time[0] will be the initial startTime. Now how does one go about calculating the endTime. If the Data Interval is 1-minute then calculating the endtime is rather simple - endTime = Time[0].AddMInute(1). But what do you due when the Data Interval is Tick, Volume, Range, etc.? The x-axis is not fixed like for a minute chart. The x-axis scale is not fixed for a Tick chart. Does one have to worry about screwing up the x-axis when drawing into the future. When drawing into the future on a variable x-axis is the calculation for endTime just as simple as for a minute chart? In other words, one can use endTime = Time[0].AddMinute(1) for all Data Intervals.
Thanks.Tags: None
-
No need to calculate. Just use the signature for a time-based line.Originally posted by scjohn View PostTo draw a line into the future, one must supply a startTime and a endTime. Most of the time, for the first DrawLine, Time[0] will be the initial startTime. Now how does one go about calculating the endTime. If the Data Interval is 1-minute then calculating the endtime is rather simple - endTime = Time[0].AddMInute(1). But what do you due when the Data Interval is Tick, Volume, Range, etc.? The x-axis is not fixed like for a minute chart. The x-axis scale is not fixed for a Tick chart. Does one have to worry about screwing up the x-axis when drawing into the future. When drawing into the future on a variable x-axis is the calculation for endTime just as simple as for a minute chart? In other words, one can use endTime = Time[0].AddMinute(1) for all Data Intervals.
Thanks.
Code:DrawLine(string tag, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY, Color color, DashStyle dashStyle, int width);
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
558 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
324 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
545 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
547 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment