Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to get a series from a drawobject
Collapse
X
-
How to get a series from a drawobject
I'm currently working on an indicator. As a part of that indicator, I have a Line and a TrendChannel being drawn. I want to use CrossAbove and CrossBelow to play a sound to alert the user of a specific change. However, I can't seem to figure out how to get a series from Line or TrendChannel in order to use CrossAbove and CrossBelow. Any help would be greatly appreciated.Tags: None
-
Thanks for the info, Chelsea. However, if that's the case, how am I supposed to do something like this:
I do see from the documentation that there are two choices for arguments with CrossAbove and CrossBelow:Code:... if (CrossAbove(High, <Line or TrendChannel>, 1)) { <do something>; } else if (CrossBelow(Low, <Line or TrendChannel>, 1)) { <do something else>; } ...
Since I can't get a series from the Draw Object, how do I get the value of that draw object at the same point in time of X bars ago?Code:CrossAbove(ISeries<double> series1, ISeries<double> series2, int lookBackPeriod) CrossAbove(ISeries<double> series1, double value, int lookBackPeriod)
Code:CrossBelow(ISeries<double> series1, ISeries<double> series2, int lookBackPeriod) CrossBelow(ISeries<double> series1, double value, int lookBackPeriod)
Comment
-
Hello learningnt,
CrossAbove()/CrossBelow() could check when the price is crossing a specific anchor but not a point along the line.
The Alerts for manually drawn lines indicator for NinjaTrader 7 had custom logic to figure out when the price was crossing diagonal lines that are not horizontal.
Updated 9-28-11: Used a simpler approach for horizontal lines and improved "no alert" message handling so that these messages should always be correctly removed. ========= This indicator will alert when the most recent bar crosses manually drawn lines. Works on lines, rays, horizontal lines, and extended lines. Apply the indicator to a chart and manually […]
The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.Chelsea B.NinjaTrader Customer Service
Comment
-
So, when creating a Line or TrendChannel, we choose anchor points on either end, and it draws a line between those anchor points. This then makes it impossible to tell if we have crossed above or below that Line or TrendChannel as we're talking about some point between anchors and not the anchors themselves. Am I interpreting that correctly? Also, I'm using NT8, not NT7.
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
602 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
347 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 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
560 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
559 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment