Thanks
Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
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
-
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
-
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 Jonker, 04-27-2024, 01:19 PM
|
3 responses
23 views
0 likes
|
Last Post Today, 05:45 PM | ||
Started by businessman1929, 04-29-2024, 01:28 PM
|
2 responses
22 views
0 likes
|
Last Post Today, 05:38 PM | ||
Started by bltdavid, 03-27-2023, 05:32 AM
|
18 responses
347 views
0 likes
|
Last Post
by ETFVoyageur
Today, 05:28 PM
|
||
Started by NM_eFe, Today, 05:15 PM
|
0 responses
5 views
0 likes
|
Last Post
by NM_eFe
Today, 05:15 PM
|
||
Started by vitaly_p, Today, 05:09 PM
|
0 responses
7 views
0 likes
|
Last Post
by vitaly_p
Today, 05:09 PM
|
Comment