Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
NT8 - editor does not support new when running nswrappers script
Collapse
X
-
NT8 - editor does not support new when running nswrappers script
NT8 - editor does not support new when running nswrappers script
Tags: None
-
Originally posted by NinjaTrader_Dierk View PostI'm not sure
a) why you manually edit the wrappers,which you never should do anyway
b) which C# language syntax would allow you doing what you're trying to do
ok the problem is this...
b)here is info for you about the "New" keyword
Use the new and override keywords in C# to specify how methods with the same name in a base and derived class interact.
the "NEW" keyword is not understood by the macro and it then creates a broken Wrapper
i provided a demo to show you the macro doesnt understand it...
can you understand that or do you want a video of it?
i realize its hard to understand unless you are at my desk wathcing :-)
Comment
-
Originally posted by NinjaTrader_Dierk View PostCould you pls provide steps which would generate that wrapper code? Thanks
Open for Edit any indicator - Bollinger for example
change the following property from
Code:[Range(0, int.MaxValue), NinjaScriptProperty] [Display(ResourceType = typeof(Custom.Resource), Name = "NumStdDev", GroupName = "NinjaScriptParameters", Order = 0)] public double NumStdDev { get; set; }
Code:[Range(0, int.MaxValue), NinjaScriptProperty] [Display(ResourceType = typeof(Custom.Resource), Name = "NumStdDev", GroupName = "NinjaScriptParameters", Order = 0)] public new double NumStdDev { get; set; }
compile
wait for error in NSWrapper generation
yes i realise in this case the change is superflous but it demonstrates the editor limitaion when the usage is used to try to prevent the recursion warning.. .when using a property to wrap around a class B derived from A + C local instance pattern common in c# etc...
for example....Last edited by MicroTrends; 05-12-2015, 04:54 AM.
Comment
-
Originally posted by NinjaTrader_Dierk View PostThanks. Will be implemented with next beta: #8209
That will negate the need for changing param names for this scenario also:
as the new keyword will stop the incorrect recursion message
therefore that has two solutions...
many thanks
that has plagued me for a long time :-)
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Waxavi, Today, 02:00 AM
|
0 responses
2 views
0 likes
|
Last Post
by Waxavi
Today, 02:00 AM
|
||
Started by elirion, Today, 01:36 AM
|
0 responses
4 views
0 likes
|
Last Post
by elirion
Today, 01:36 AM
|
||
Is it possible to have a drawing, such as a line, cycle through different colors?
by gentlebenthebear
Started by gentlebenthebear, Today, 01:30 AM
|
0 responses
4 views
0 likes
|
Last Post Today, 01:30 AM | ||
Started by samish18, Yesterday, 08:31 AM
|
2 responses
9 views
0 likes
|
Last Post
by elirion
Today, 01:28 AM
|
||
Started by Mestor, 03-10-2023, 01:50 AM
|
16 responses
391 views
0 likes
|
Last Post
by z.franck
Today, 01:04 AM
|
Comment