I'm developing an indicator and I've just added another property parameter to my code. The software works fine with the initial value assigned to this new parameter. But, for some reason, it doesn't appear in the parameter list when I open the indicator. Notice that deleting any other parameter from my script, then, it appears in the indicator GUI. I've tried any combination, changed names, etc. but nothing worked for me. I need only four parameters in my indicator but it looks like my system is limiting me to three parameters only. What can I do?
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
Limited Number of Parameters
Collapse
X
-
Limited Number of Parameters
Hello,
I'm developing an indicator and I've just added another property parameter to my code. The software works fine with the initial value assigned to this new parameter. But, for some reason, it doesn't appear in the parameter list when I open the indicator. Notice that deleting any other parameter from my script, then, it appears in the indicator GUI. I've tried any combination, changed names, etc. but nothing worked for me. I need only four parameters in my indicator but it looks like my system is limiting me to three parameters only. What can I do?Tags: None
-
Hello,
Below you can see the variables region from my script as well as my Properties region.
I hope you could figure out what the problem is.
Thank you for your help.
#region Variables
// parameter variables
// ======================
private int minimumNumberOfBarsToDrawAline = 15;
private int numberOfBackBarsToAnalize = 40;
private bool plotHistory = true;
private bool plotIndicator = true;
// User defined variables
// ======================
// Point parameters
private DataSeries X;
private DataSeries Y;
private DataSeries S; // line slope
private DataSeries Tag;
private DataSeries LineStatus;
// LineStatus possible values:
private const double CONNECT_POINTS = 1.0;
private const double CONNECT_NONE = 2.0;
private const double CONNECT_UNDEF = 3.0;
private const double VALID_LINE = 4.0;
private double TagIndex;
private int ii;
private int jj;
private bool PointsMustBeBelowTheLine;
private bool PointsMustBeAboveTheLine;
private double b;
private double YOnTheLine;
#endregion
#region Properties
[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
[XmlIgnore()] // this line ensures that the indicator can be saved/recovered as part of a chart template, do not remove
[Description("")]
[GridCategory("Parameters")]
public int NumberOfBackBarsToAnalize
{
get { return numberOfBackBarsToAnalize; }
set { numberOfBackBarsToAnalize = Math.Max(2, value); }
}
[Description("")]
[GridCategory("Parameters")]
public int MinimumNumberOfBarsToDrawAline
{
get { return minimumNumberOfBarsToDrawAline; }
set { minimumNumberOfBarsToDrawAline = Math.Max(3, value); }
}
[GridCategory("Parameters")]
public bool PlotHistory
{
get { return plotHistory; }
set { plotHistory = value; }
}
[GridCategory("Parameters")]
public bool PlotIndicator
{
get { return plotIndicator; }
set { plotIndicator = value; }
}
#endregion
Comment
-
Remove this line:
Code:[Browsable(false)] // this line prevents the data series from being displayed in the indicator properties dialog, do not remove
Code:public DataSeries Plot0 { get { return Values[0]; } }
Comment
-
YES!!, you are right, everything is working fine now.
By the way, I've intentionally deleted the Plot0 parameter. I have no Add command in the Initialize method.
The indicator receives the data from the graph where it is applied.
I know it's not the general way you explain how to use NinjaScript, but it works fine and all the commands in my script refers to the default input.
Do you think this method can be problematic in some way?
Thanks a lot for your help.
Carlos
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by f.saeidi, Today, 08:01 PM
|
0 responses
2 views
0 likes
|
Last Post
by f.saeidi
Today, 08:01 PM
|
||
Change colour of Stop market and limit orders to red and green via indicator script
by Rapine Heihei
Started by Rapine Heihei, Today, 07:51 PM
|
0 responses
3 views
0 likes
|
Last Post Today, 07:51 PM | ||
Started by frslvr, 04-11-2024, 07:26 AM
|
5 responses
96 views
1 like
|
Last Post
by caryc123
Today, 07:47 PM
|
||
Started by algospoke, 04-17-2024, 06:40 PM
|
6 responses
49 views
0 likes
|
Last Post
by algospoke
Today, 06:18 PM
|
||
Started by arvidvanstaey, Today, 02:19 PM
|
4 responses
11 views
0 likes
|
Last Post Today, 04:08 PM |
Comment