Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Trend Line
Collapse
X
-
Trend Line
I have a strategy that I have created with the wizard. I do not want to unlock it. I have a condition that determines an Uptrend is true. My question is how can I tell the Strategy, using the wizard, to draw a line from the first low that the uptrend conditon is true to the last low that the conditon is true? (UpTrendLine)Tags: None
-
If the drawing objects are bogging your system down, maybe consider changing bar color or using the other visual cues.
See the link below for reducing NinjaTrader's resource requirements, which may help your system run more efficiently.
Click here to view the NinjaTrader performance tipsRyan M.NinjaTrader Customer Service
Comment
-
How would change color have any affect on performance? I am trying to use other visual cues, that why I want to draw one line instead of 30 or 40 diamonds. If I unlocked the code how would you program the TrendLine from low to low as long as the conditon was true?
Comment
-
Drawing creates a separate object to track for each bar. BarColor changes the property of existing bars. It doesn't add new objects.
There may be other ways to implement through code. Here's just one:
You could setup two sequences and use a bool flags to create the sequence you're looking for.
Example Snippet:
Code:#region Variables private bool firstBar; private int conditionBar; private int barsAgoValue; #endregion if (Close[0] > Open[0] && firstBar) { conditionBar = CurrentBar; firstBar = false; } else if (!firstBar) { barsAgoValue = CurrentBar - conditionBar; firstBar = true; DrawLine("line" + CurrentBar, barsAgoValue, Low[barsAgoValue], 0, Low[0], Color.Red); }
Ryan M.NinjaTrader Customer Service
Comment
-
firstBar is the bool flag. It's used to create the sequence - first check when the condition is true, next check when it's not.
conditionBar captures the CurrentBar value for the bar that the condition occurred.
barsAgo tells us how many bars back the first condition occurs.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
649 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
370 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
109 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
574 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
576 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment