Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Print/Get Strategy Properties
Collapse
X
-
Print/Get Strategy Properties
I have a large number of properties, and would like to print or save a copy of the values currently assigned. I am looking for a way to get the property collection for the strategy (read-only is fine). From there should be easy enough to sort thru, but I am not seeing a built-in way to get the property collection. Can this be done? Can you provide an example of how to do?
Tags: None
-
-
Yes, I have seen that sample, but how do you get the PropertyDescriptorCollection from within a strategy (i.e. from OnStateChange). Or how to get a ref to the TypeConverter for the strategy? Once you have that the rest of the sample becomes pertinent.
Normally, I would just print them out like you say, but I have a framework that has a rather large number, and it continues to change so having a routine that just works by iterating the collection would be nice.
Comment
-
Hello aslane,
The custom converter can be used in a strategy.
I guess if you wanted to access this from OnStateChange instead of where it is available from the converter you could copy the collection to another variable and loop through that in OnStateChange if its not null or empty..
This would be outside of what is supported by NinjaTrader and would require a custom solution.Chelsea B.NinjaTrader Customer Service
Comment
-
Ok, I've been able to find and sort thru which properties should be displayed. The only piece I am missing is finding the Category Order Attributes attached to the strat/ind (i.e. [Gui.CategoryOrder("Entry", 800010)] placed above class), so I can properly sort them on output. Can you provide a little hint on how to get that attribute collection?
Comment
-
Hello aslane,
Getting the Category Order attributes programmatically would be outside of what is supported by NinjaTrader Support and I do not have further information about that.
This thread will remain open for any community members that may know how to find this information.Chelsea B.NinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Mestor, 03-10-2023, 01:50 AM
|
11 responses
303 views
0 likes
|
Last Post
by z.franck
Today, 02:29 AM
|
||
Started by Padan, Today, 02:02 AM
|
0 responses
6 views
0 likes
|
Last Post
by Padan
Today, 02:02 AM
|
||
Started by bukowa, 11-09-2023, 06:07 PM
|
20 responses
407 views
0 likes
|
Last Post
by Adfra
Today, 01:36 AM
|
||
Started by yertle, Yesterday, 05:49 PM
|
2 responses
11 views
0 likes
|
Last Post
by yertle
Today, 12:12 AM
|
||
Started by kaywai, Today, 12:06 AM
|
0 responses
10 views
0 likes
|
Last Post
by kaywai
Today, 12:06 AM
|
Comment