thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Trigger order off user-defined line
Collapse
X
-
Astro. Here's an example using the ILine object
you can reference this object price value (or Y value) as such.Code:ILine lObj; //Make this global OnInitialize() { lObj = null; } //Create a line (somewhere in your code) lObj = DrawLine("sometag", true, 10, Close[0], 0, Close[0], Color.DimGray, DashStyle.Solid, 2);
You have a StartY and an EndY. These are two different endpoints that can be different values, unless you have a perfectly horizontal line. The help file describes these two ponits.Code:// Its good practice to ensure you don't reference a null object. if(lObj != null) { //EndY here is the price of the line on the chart. if(somevalue > lObj.EndY) { ... } }
You can also checkout IRay, IHorizontalLine, etc.
Hope this helps.
Comment
-
Betrand, in Ray's video at 20:47, he says that you can draw a line manually on a chart, then access it in a NT script (indicator) using its tag value. How would you do that?
Is there a collection of Line objects that I need to loop through, searching for the tag, or is there a more direct method if I pass the tag into the indicator as a parameter?
Comment
-
Correct, you would need to loop through the tag ID collection, please see this thread here a snippet related - http://www.ninjatrader-support2.com/...ad.php?t=18540
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by kinfxhk, 07-13-2026, 10:18 AM
|
0 responses
28 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 10:18 AM
|
||
|
Started by kinfxhk, 07-13-2026, 09:50 AM
|
0 responses
18 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 09:50 AM
|
||
|
Started by kinfxhk, 07-13-2026, 07:21 AM
|
0 responses
26 views
0 likes
|
Last Post
by kinfxhk
07-13-2026, 07:21 AM
|
||
|
Started by kinfxhk, 07-11-2026, 02:11 AM
|
0 responses
24 views
0 likes
|
Last Post
by kinfxhk
07-11-2026, 02:11 AM
|
||
|
Started by SalmaTrader, 07-07-2026, 10:26 PM
|
0 responses
139 views
0 likes
|
Last Post
by SalmaTrader
07-07-2026, 10:26 PM
|

Comment