Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Optional parameters
Collapse
X
-
Optional parameters
How can I define the public variable of an indicator so that it is 'optional' when the indicator is instantiated from within another indicator? For instance I have defined an indicator where one of the public variable is the thickness of the plot...I don't want to have to specify the thickness of the plot each time I instantiate that indicator to access its other properties.Tags: None
-
David, what I mean was you create basically two indicators that would give you also 2 overloads then to call programmatically for your other scripts - for the 'system' one just use only the public properties you would like to adjust via code, the other hardcode in so the overload gets 'cleaned' up.
Comment
-
Unfortunately not - you would simply make a copy of your indicator and then remove some of the unneeded public properties / user inputs and instead set a hard-coded value as internal variable only (which is done anyways in the code), if you them compile changes in another indicator overload is created which you could use to simplify calling the needed value from yet another script.
Comment
-
Thanks, I will try this. Also when calling my indicator through code, the Intellisense kicks in and provides a few potential combinations of parameters. Usually one will include "Input" then the list of custom parameters, and another will just include the list of custom parameters (Input then becomes optional). Would the overload you propose show up in this Intellisense?
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
648 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
369 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
108 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
572 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
573 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment