Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Template

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

    Strategy Template

    Hi,

    When a template is loaded for a strategy, is there any way the strategy can discern the name of the template that was loaded? Is there a public variable or property exposed from some other module / class that contains the template name? Or is there some method or function that can be overridden to intercept that information?

    Thanks,

    CJ

    #2
    Hello ChazJ,

    To the strategy it would not know what template was applied, it simply has the values copied to its object. One way to do this would be to add a String property to your script and then just type in the template name into the input. When you save the template it will save the string so that when you reload the template that input will have the name you saved. its a manual step but would work for the purpose and would only need set when saving the template initially.

    Code:
    public string TemplateName {get; set;}
    I look forward to being of further assistance.

    Comment


      #3
      Sounds like a good workaround. Thanks.

      Comment


        #4
        Originally posted by NinjaTrader_Jesse View Post
        Hello ChazJ,

        To the strategy it would not know what template was applied, it simply has the values copied to its object. One way to do this would be to add a String property to your script and then just type in the template name into the input. When you save the template it will save the string so that when you reload the template that input will have the name you saved. its a manual step but would work for the purpose and would only need set when saving the template initially.

        Code:
        public string TemplateName {get; set;}
        I look forward to being of further assistance.
        Hello, would it be possible to obtain those values copied to its object or locate and know the name of the file that is linked to the strategy to save this data?

        Comment


          #5
          Originally posted by RubenCazorla View Post

          Hello, would it be possible to obtain those values copied to its object or locate and know the name of the file that is linked to the strategy to save this data?
          What data are you looking to save and where? Are you referring to the TemplateName string? The name of the template file linked to the strategy would be the name given to the template; the idea is to save the string with the same name that you manually give to the template when saving the strategy template. There is no way to programmatically access the template name. If you are looking for a way to programmatically access a string, such as TemplateName, please provide more details about what you are hoping to achieve so I may better understand and assist you.

          Thank you for your patience.

          Comment


            #6
            Originally posted by NinjaTrader_Emily View Post

            What data are you looking to save and where? Are you referring to the TemplateName string? The name of the template file linked to the strategy would be the name given to the template; the idea is to save the string with the same name that you manually give to the template when saving the strategy template. There is no way to programmatically access the template name. If you are looking for a way to programmatically access a string, such as TemplateName, please provide more details about what you are hoping to achieve so I may better understand and assist you.

            Thank you for your patience.
            What I want to obtain is the name of the xaml file of the template loaded by the strategy at that moment, the purpose is to obtain the values ​​of that template. It would also be helpful if it were possible to use the string that is used to create the xaml to convert it to a string and thus have the content in the same way as the xaml.

            Comment


              #7
              Originally posted by RubenCazorla View Post

              What I want to obtain is the name of the xaml file of the template loaded by the strategy at that moment, the purpose is to obtain the values ​​of that template. It would also be helpful if it were possible to use the string that is used to create the xaml to convert it to a string and thus have the content in the same way as the xaml.
              There is currently no way to do this programmatically. That is why my colleague suggested a manual workaround of saving a string user input with the same name you give to the template when saving it. The input string could be accessed programmatically. Accessing the xaml file of a template programmatically is also not supported. That said, I have submitted this as a feature request to the Development Team and will follow up with an internal tracking number for your reference as soon as it is created. If this request already exists, your vote will be added to track additional interest.

              Thanks in advance for your patience.

              Comment


                #8
                Hello RubenCazorla,

                Thanks for your patience.

                The internal tracking number for your feature request is SFT-6180. Please reference this internal tracking number when contacting Platform Support if you ever have questions regarding this feature request.

                When a feature request is implemented, you'll find a description of the new feature in the release notes:Thank you for using NinjaTrader.​

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by NullPointStrategies, Yesterday, 05:17 AM
                0 responses
                58 views
                0 likes
                Last Post NullPointStrategies  
                Started by argusthome, 03-08-2026, 10:06 AM
                0 responses
                133 views
                0 likes
                Last Post argusthome  
                Started by NabilKhattabi, 03-06-2026, 11:18 AM
                0 responses
                73 views
                0 likes
                Last Post NabilKhattabi  
                Started by Deep42, 03-06-2026, 12:28 AM
                0 responses
                45 views
                0 likes
                Last Post Deep42
                by Deep42
                 
                Started by TheRealMorford, 03-05-2026, 06:15 PM
                0 responses
                50 views
                0 likes
                Last Post TheRealMorford  
                Working...
                X