![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| General Programming General NinjaScript programming questions. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Jul 2011
Posts: 37
Thanks: 11
Thanked 6 times in 3 posts
|
Is it possible to constrain parameter values to certain acceptable values? For example if I have an int Parameter, can I constrain valid input values to the range 1 to 10. (Similar to ASP.NET validation controls for those familiar)
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Aug 2011
Location: Denver, CO, USA
Posts: 2,895
Thanks: 241
Thanked 375 times in 365 posts
|
overflowing,
There is a section of code in the properties region where you can set a maximum or minimum value. For example : Code:
[Description("Number of bars used for calculation")]
[GridCategory("Parameters")]
public int Period
{
get { return period; }
set { period = Math.Max(1, value); }
}
Adam P.
NinjaTrader Customer Service |
|
|
|
|
The following user says thank you to NinjaTrader_AdamP for this post: |
|
![]() |
| Tags |
| parameter |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Read in GUI parameter values from text file | roland_nt | Indicator Development | 2 | 04-25-2012 06:51 PM |
| Reading parameter values | Stephan123 | Strategy Development | 10 | 11-21-2011 03:21 PM |
| Is it possible to set parameter values dynamically? | pauluk | General Programming | 2 | 11-23-2010 10:50 AM |
| Constrain trendlines with shift key | billworld | Charting | 1 | 08-09-2010 11:52 AM |
| Default Parameter Values | toptrader | Strategy Development | 4 | 09-04-2009 10:30 AM |