I have an indicator (B) which I call from another indicator (A). In the indicator being called, B, I have a property decorated with the ReadOnly attribute. It is NOT decorated with the [NinjaScript] attribute. I have noticed that in the indicator doing the calling, A, intellisense shows that the read only property of B needs to be specified as part of the call. Is there a way to prevent this?
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Property Attributes
Collapse
X
-
Property Attributes
Hi,
I have an indicator (B) which I call from another indicator (A). In the indicator being called, B, I have a property decorated with the ReadOnly attribute. It is NOT decorated with the [NinjaScript] attribute. I have noticed that in the indicator doing the calling, A, intellisense shows that the read only property of B needs to be specified as part of the call. Is there a way to prevent this?Tags: None
-
Hello Zeos6,
Could you confirm if you are in fact not using the [NinjaScriptProperty] attribute on your property for indicator A?
The [NinjaScriptProperty] attribute would be the attribute used for generating overloads in the NinjaScript generated code and would determine what parameters are needed in an indicator call. The property will still be visible in the Indicators dialog property grid, though. The [ReadOnly(true)] attribute should disable the setter and prevent interaction with the property in the property grid.
Setting up a demo of your case, we can see the effect the [NinjaScriptProperty] attribute has.
Demo: https://www.screencast.com/t/lGv3pcdh
NinjaScriptProperty attribute - https://ninjatrader.com/support/help...yattribute.htm
Please let me know if we can be of further assistance.JimNinjaTrader Customer Service
Comment
-
Hi Jim,
Thank you for your reply. I am NOT using the [NinjaScriptProperty] attribute on the property decorated with the [ReadOnly(true)] attribute.
EDIT: The Strange thing is that in the compiled version of the indicator being called the partial class in the NT generated code still shows the property even though it is NOT marked with [NinjaScriptProperty].
EDIT2: My code related to this issue looks almost identical to your demo except that my read only variable is a string.Last edited by Zeos6; 06-26-2018, 10:01 AM.
Comment
-
Hello Zeos6,
I see the same behavior in the demo as I do when using a string. I've attached the test scripts so you may test what I am verbatim. Do you still see differing results following what I do in the demo? Keep in mind we will have to wait for compilation to finish before we can expect Inteliprompt to change.
If you are still seeing the old NinjaScript generated code persist, do you still encounter this issue after restarting the platform? What about deleting the NinjaScript generated code before compiling?
Could you also verify that you are on the latest version of NinjaTrader 8, version 14.2?
I'll be happy to assist you further.Attached FilesJimNinjaTrader Customer Service
Comment
-
Hi Jim,
1. Yes, I AM seeing the old NinjaScript generated code persist.
2. I still encounter this issue after restarting the platform.
3. When I delete the NinjaScript generated code and compile again, the same old code returns.
4. Yes, I am using NT8 release 14.2.
I will check your files. Thank you for sending them.
Comment
-
Hi Jim,
I have isolated the problem and I am able to reproduce it, even using your sample code. However, I am not sure what is happening. Doesn't really make sense to me.
In your IndiA properties...
1. If you use...
Code:#region Properties //Set NinjaScriptProperty to ... [ReadOnly(true)] //[NinjaScriptProperty] [Display(Name="Period", Order=1, GroupName="Parameters")] public string Period { get; set; } [Browsable(false)] [XmlIgnore] public Series<double> MyPlot { get { return Values[0]; } } #endregion
2. If you use...
Code:#region Properties /* //Set NinjaScriptProperty to ... */ [ReadOnly(true)] //[NinjaScriptProperty] [Display(Name="Period", Order=1, GroupName="Parameters")] public string Period { get; set; } [Browsable(false)] [XmlIgnore] public Series<double> MyPlot { get { return Values[0]; } } #endregion
BUT if you use...
Code:#region Properties /* Set NinjaScriptProperty to ... */ [ReadOnly(true)] //[NinjaScriptProperty] [Display(Name="Period", Order=1, GroupName="Parameters")] public string Period { get; set; } [Browsable(false)] [XmlIgnore] public Series<double> MyPlot { get { return Values[0]; } } #endregion
It therefore appears that the compiler reads and executes NinjaScriptProperty on the property even if it is a part of a comment block, and even if it is not enclosed within square parentheses. Your thoughts on this would be greatly appreciated. Thank you for your help. I really do appreciate it.
Comment
-
Hello Zeos6,
It looks like a bug with NinjaScript generated code. I've reported it further and will update this post as this gets further reviewed. In the meantime, I would suggest to avoid using block comments before a property where you wish to not use the [NinjaScriptProperty] attribute.JimNinjaTrader Customer Service
Comment
-
Hello Zeos6,
Development has confirmed this as a bug and has assigned the ticket ID NTEIGHT-12964 to track this issue. The ticket ID number can be referenced in the Release Notes page of the help guide when a new version of NinjaTrader includes a fix for the issue.
Release Notes - https://ninjatrader.com/support/help...ease_notes.htmJimNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by frslvr, 04-11-2024, 07:26 AM
|
8 responses
111 views
1 like
|
Last Post Today, 10:30 AM | ||
Started by stafe, 04-15-2024, 08:34 PM
|
10 responses
44 views
0 likes
|
Last Post
by stafe
Today, 10:29 AM
|
||
Started by rocketman7, Today, 09:41 AM
|
3 responses
8 views
0 likes
|
Last Post Today, 10:07 AM | ||
Started by traderqz, Today, 09:44 AM
|
2 responses
5 views
0 likes
|
Last Post Today, 10:00 AM | ||
Started by rocketman7, Today, 02:12 AM
|
7 responses
31 views
0 likes
|
Last Post Today, 09:23 AM |
Comment