RangeAttribute
<< Click to Display Table of Contents >> RangeAttribute |
Determines if the value of the following declared property is valid within a specified range. These values are checked when the NinjaScript object has reached State.Configure. For configuration through the UI (e.g., the user has selected Apply or OK to configure the value from the indicator dialog box) and determines to be invalid, the value will be automatically rounded to the nearest minimum or maximum value. Should the property be set as a NinjaScriptAttribute and called from a hosting NinjaScript object and determines to be invalid, an exception will be thrown and the hosted indicator will NOT execute.
Note: The RangeAttribute object is a general purpose attribute made available from the .NET Framework. The information on this page is written to demonstrate how you may use this object within NinjaScript conventions used for the NinjaTrader UI's property grid (e.g., an indicator dialog). There are more methods and properties that you can learn about from MSDN's RangeAttribute Class which are NOT covered in this topic; as such there is NO guarantee they will work with the NinjaTrader UI's property grids. |
[Range(int minimum, int maximum)]
[Range(double minimum, double maximum)]
[Range(type type, string minimum, string aximum)]
maximum |
Defines the highest allowed value the user can set for the property |
minimum |
Defines the lowest allowed value the user can set for the property |
type |
The type of object to test |
#region Properties |