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 martin70, 03-24-2023, 04:58 AM
|
14 responses
105 views
0 likes
|
Last Post
by martin70
Today, 04:42 AM
|
||
Started by TraderBCL, Today, 04:38 AM
|
0 responses
2 views
0 likes
|
Last Post
by TraderBCL
Today, 04:38 AM
|
||
Started by Radano, 06-10-2021, 01:40 AM
|
19 responses
606 views
0 likes
|
Last Post
by Radano
Today, 04:00 AM
|
||
Started by KenneGaray, Today, 03:48 AM
|
0 responses
4 views
0 likes
|
Last Post
by KenneGaray
Today, 03:48 AM
|
||
Started by thanajo, 05-04-2021, 02:11 AM
|
4 responses
470 views
0 likes
|
Last Post Today, 03:40 AM |
Comment