Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
B5 NT-generated code fails when enums are exposed as parameters
Collapse
X
-
B5 NT-generated code fails when enums are exposed as parameters
Please see the attached file to reproduce. This compiled in previous beta builds, as well as NT7.Tags: None
-
Ok, though the same issue is present when the enum is scoped even publically as an indicator class member. This is valid code and will compile, if not for the NT generated code. Worked in previous builds of 8 and in 7 too. If you scope enums outside the indicator namespace you create a global name collision potential across the other namespaces. If developers A and B try to use the same enum name there will be chaos for customers at install time. Let me know if I'm missing something here...
Comment
-
I can definitely see your concern. Just to be sure this is not a new bug, I've just retested your original code on Beta 4 and Beta 3, but I'm seeing the same scope error that I saw on Beta 5. Can you think of anything else that was different in your implementation of this code in B4 or B3 (or earlier)?Dave I.NinjaTrader Product Management
Comment
-
In code I wrote in B3-B4 I have enums scoped as public class members then exposed as parameters, which compiled and worked fine at run time. I looked in my source control change logs and in previous builds the NT generated code wasn't including the enums in the constructors. In B5 it does include them and won't compile. So it would seem to be this is a new issue in B5.
If I take one of the previous versions from source control with the enums and the old footer code and compile in B5 it works. But once I touch anything in the properties section of the code NT regenerates the footer code and breaks the build.
Hope this helps (and helps get this fixed in B6 ;-} )...
Comment
-
Originally posted by RanchoDinero View PostIn code I wrote in B3-B4 I have enums scoped as public class members then exposed as parameters, which compiled and worked fine at run time. I looked in my source control change logs and in previous builds the NT generated code wasn't including the enums in the constructors. In B5 it does include them and won't compile. So it would seem to be this is a new issue in B5.
If I take one of the previous versions from source control with the enums and the old footer code and compile in B5 it works. But once I touch anything in the properties section of the code NT regenerates the footer code and breaks the build.
Hope this helps (and helps get this fixed in B6 ;-} )...
Comment
-
Thanks but nope. Not the case. The issue is what I described. The same code which is decorated correctly compiles and runs in earlier builds, not in b5.
Comment
-
I've got an update (and good news) on this one. You should be able to declare and define your enum within the Indicators namespace, but the key is that you will need to use a fully qualified name when declaring your properties:
Code:public NinjaTrader.NinjaScript.Indicators.FooEnum Bar { get; set; }
Dave I.NinjaTrader Product Management
Comment
-
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by ghoul, Today, 06:02 PM
|
2 responses
12 views
0 likes
|
Last Post
by ghoul
Today, 06:36 PM
|
||
Started by jeronymite, 04-12-2024, 04:26 PM
|
3 responses
44 views
0 likes
|
Last Post
by jeronymite
Yesterday, 10:10 PM
|
||
Started by Barry Milan, Yesterday, 10:35 PM
|
7 responses
20 views
0 likes
|
Last Post Today, 06:16 PM | ||
Started by AttiM, 02-14-2024, 05:20 PM
|
10 responses
180 views
0 likes
|
Last Post
by jeronymite
Today, 06:11 PM
|
||
Started by DanielSanMartin, Yesterday, 02:37 PM
|
2 responses
13 views
0 likes
|
Last Post Today, 05:26 PM |
Comment