Thanks
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Ending DrawExtendedLine
Collapse
X
-
Ending DrawExtendedLine
I want to draw a horizontal line. I know the starting point, but I don't know the end point until a certain criteria happens sometime in the future. Can I use DrawExtendedLine and somehow "end" it when my criteria happens, or do I need to use DrawLine and keep removing it and re-drawing it for each bar, until my criteria happens ? (which would take much more processing than necessary). I'm using version 7.
Thanks -
trader416,
You would need to create two conditions where both are using the same DrawExtendedLine tag, but the end values will change where the condition is true or not true.
So for example, when the condition is not true, you would use the current bar and price values for the draw object, but when the condition is true you would set the exact X and Y value you intend to use for this object.
Please let me know if you need further clarification.MatthewNinjaTrader Product Management
-
Thanks. That makes sense.
However, I keep getting a compile error with Extended lines. When I use DrawLine, it's fine, but my extended line always gets a CS1501 error. I'm using Version 7, and here's the code I'm using:
DrawExtendedLine("RHline", 1, RangeH, 0, RangeH, Color.Blue, DashStyle.Solid, 1);
Any ideas what's wrong ?
Thanks.
Comment
-
trader416,
You'll have to use one of the supported overloads for this. Intellisense can help build this. Type DrawExtendedLine( You'll see one overload available, and can toggle among them using your arrow up and down keys.
They're also available here:
Last edited by NinjaTrader_RyanM1; 07-17-2011, 06:47 PM.Ryan M.NinjaTrader Customer Service
Comment
-
Ryan_M,Originally posted by NinjaTrader_RyanM View Posttrader416,
You'll have to use one of the supported overloads for this. Intellisense can help build this. Type DrawExtendedLine( You'll see one overload available, and can toggle among them using your arrow up and down keys.
They're also available here:
http://www.ninjatrader.com/support/h...tendedline.htm
I don't understand. I thought I had done that. I posted the line of code in a previous post. I followed the IntelliSense, and checked it against code that others have written for DrawExtendedLine, but I still get this error. I have 8 arguments.
Comment
-
Exactly. The message is "No overload... takes '8' arguments".Originally posted by trader416 View Postbut I still get this error. I have 8 arguments.
One way to see the overloads available is with intellisense. The other is with the documentation. I've pasted below the three potential overloads expected and the example from the documentation.
Code:DrawExtendedLine(string tag, int startBarsAgo, double startY, int endBarsAgo, double endY, Color color) DrawExtendedLine(string tag, bool autoScale, int startBarsAgo, double startY, int endBarsAgo, double endY, Color color, DashStyle dashStyle, int width) DrawExtendedLine(string tag, bool autoScale, DateTime startTime, double startY, DateTime endTime, double endY, Color color, DashStyle dashStyle, int width) DrawExtendedLine("tag1", false, 10, Close[10], 0, Close[0], Color.LimeGreen, DashStyle.Dot, 2);Ryan M.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
579 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
554 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