Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Changing the value of indicator lines.
Collapse
X
-
Hello Kaiviti57,
Thanks for your post.
If you have horizontal lines being placed on the chart by calling the AddLine() method or the Draw.HorizontalLine() method, you would need to ensure that your user-defined variables are being used when calling the method that makes a horizontal line in your script.
For example, if you have a user-defined property called LineUpper, this variable would need to be used when calling your method to place the lines. If you are using AddLine(), the code might look something like below.
AddLine(Brushes.Gray, LineUpper, "Upper");
See the help guide documentation below for more information.
AddLine(): https://ninjatrader.com/support/help...t8/addline.htm
Draw.HorizontalLine(): https://ninjatrader.com/support/help...zontalline.htm
Let us know if we may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
-
Hello Kaiviti57,
Thanks for your note.
I see that you are calling AddLine() in State.SetDefaults. State.SetDefaults is only processed once when initially applying the indicator to a chart.
You would need to move the AddLine() methods in the script to State.Configure if you would like to update the values of AddLine() dynamically based on a user-defined input. The code might look something like this.
See this help guide page for more information and sample code: https://ninjatrader.com/support/help...t8/addline.htmCode:else if (State == State.Configure) { AddLine(Brushes.Linen, 0, "Zero"); AddLine(Brushes.Olive, LineUpper, "Upper"); AddLine(Brushes.Firebrick, LineLower, "Lower"); }
Let us know if we may assist further.<span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Mindset, 04-21-2026, 06:46 AM
|
0 responses
44 views
0 likes
|
Last Post
by Mindset
04-21-2026, 06:46 AM
|
||
|
Started by M4ndoo, 04-20-2026, 05:21 PM
|
0 responses
56 views
0 likes
|
Last Post
by M4ndoo
04-20-2026, 05:21 PM
|
||
|
Started by M4ndoo, 04-19-2026, 05:54 PM
|
0 responses
35 views
0 likes
|
Last Post
by M4ndoo
04-19-2026, 05:54 PM
|
||
|
Started by cmoran13, 04-16-2026, 01:02 PM
|
0 responses
95 views
0 likes
|
Last Post
by cmoran13
04-16-2026, 01:02 PM
|
||
|
Started by PaulMohn, 04-10-2026, 11:11 AM
|
0 responses
57 views
0 likes
|
Last Post
by PaulMohn
04-10-2026, 11:11 AM
|

Comment