Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Optimizer doesn't allow uint as range input
Collapse
X
-
Hi Ben!
As it seems you are not familiar with C# programming so you might forward this topic to a programmer in your company.
A good programmer usually chooses the correct data type because you can't trust user input. That is what I did in my custom strategy:
Code:private uint NotEverGetNegative;
With the uint datatype it is not possible to choose values in the strategy optimizer. This is Min. Value, Max. Value and Increment.
For the int datatype it works. Of course point beeing, int nearly same as uint.
Comment
-
Hello,
I am familiar with C#, but only in the context of NinjaScript. I have never seen that type used in NS. If I understand, uint will never be negative. Is that what you want? If so, the following will maintain a zero value for an negative int. Or you can modify it to change return absolute value etc. of what you want. This is found in Properties.
[Description("")]
[Category("Parameters")]
publicint MyInput0
{
get { return myInput0; }
set { myInput0 = Math.Max(0, value); }
}
DenNinjaTrader Customer Service
Comment
-
Why make it simple if there's a complicated way to do it...
No offense here but these value types are basic programming skills found in every programming book on the first pages.
Anyway just consider adding it to the supported types in the strategy analyser. Thx!
I'm out!
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ninza33, Today, 07:16 AM
|
3 responses
13 views
0 likes
|
Last Post
by ninza33
Today, 09:01 AM
|
||
Started by foxtrott21, Today, 08:27 AM
|
0 responses
1 view
0 likes
|
Last Post
by foxtrott21
Today, 08:27 AM
|
||
Started by jaypelle3, Today, 08:26 AM
|
0 responses
1 view
0 likes
|
Last Post
by jaypelle3
Today, 08:26 AM
|
||
Started by linkcou, Today, 07:01 AM
|
2 responses
24 views
0 likes
|
Last Post
by bltdavid
Today, 08:25 AM
|
||
Started by jaypelle3, Today, 08:25 AM
|
0 responses
6 views
0 likes
|
Last Post
by jaypelle3
Today, 08:25 AM
|
Comment