What method do I use to notify the user at input time that there has been an error?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Validate user input
Collapse
X
-
Validate user input
I want to validate user input. As an example, on an ma crossover, the user enters a 5 for the long trend and a 20 for the short trend. The entries have been reversed.
What method do I use to notify the user at input time that there has been an error?Tags: None
-
Hello dukeb,
You can do the validation in the setter of the property. A sample code will be like
[Description("Period for slow MA")]
Please let me know if I can assist you any further.Code:[GridCategory("Parameters")] public int Slow { get { return slow; } set { slow = Math.Max(1, value); if (fast > slow) //fast is the other property { System.Windows.Forms.MessageBox.Show("Fast cannot be greater than Slow"); //do some other stuffs } } }JoydeepNinjaTrader Customer Service
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