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!
See more
See less

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.
    JesseNinjaTrader Customer Service

    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.
          Emily C.NinjaTrader Customer Service

          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.
              Emily C.NinjaTrader Customer Service

              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.​
                Emily C.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by r68cervera, Today, 05:29 AM
                0 responses
                2 views
                0 likes
                Last Post r68cervera  
                Started by geddyisodin, Today, 05:20 AM
                0 responses
                3 views
                0 likes
                Last Post geddyisodin  
                Started by JonesJoker, 04-22-2024, 12:23 PM
                6 responses
                35 views
                0 likes
                Last Post JonesJoker  
                Started by GussJ, 03-04-2020, 03:11 PM
                12 responses
                3,239 views
                0 likes
                Last Post Leafcutter  
                Started by AveryFlynn, Today, 04:57 AM
                0 responses
                6 views
                0 likes
                Last Post AveryFlynn  
                Working...
                X