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
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.Brandon H.NinjaTrader Customer Service
-
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.
Code: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.Brandon H.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ezrollin, 02-26-2022, 11:14 PM
|
7 responses
206 views
0 likes
|
Last Post
by kenz987
Today, 08:36 PM
|
||
Started by rocketman7, Today, 08:34 PM
|
0 responses
1 view
0 likes
|
Last Post
by rocketman7
Today, 08:34 PM
|
||
Started by rt61968, 02-17-2018, 05:24 PM
|
3 responses
2,733 views
0 likes
|
Last Post
by MasterEtrad3
Today, 08:12 PM
|
||
Started by nuobo, Today, 07:43 PM
|
0 responses
4 views
0 likes
|
Last Post
by nuobo
Today, 07:43 PM
|
||
Started by ETFVoyageur, Today, 02:04 PM
|
3 responses
22 views
0 likes
|
Last Post
by ETFVoyageur
Today, 07:04 PM
|
Comment