Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Print/Get Strategy Properties

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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?


    #2
    use print("Text Here "); and check output window

    Comment


      #3
      Hello aslane,

      It would be better to print the exact properties you are looking for.

      However, you may be able to loop through the PropertyDescriptorCollection.
      Below is a link to a reference sample that shows how to use this collection.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        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


          #5
          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


            #6
            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


              #7
              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


                #8
                Thanks, found them, were sitting further up in the inheritance tree.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Today, 05:17 AM
                0 responses
                24 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                120 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                63 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                41 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                46 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X