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

Command for Load Template

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

    Command for Load Template

    Dear Support,

    I am developing a button for loading chart templates and looking for the associated NinjaTrader Command. Could please suggest the correct command for "Templates.Load"

    Command = "Templates.Load"

    Thanks.

    #2
    Hello alligator,

    Thanks for your post.

    We do not offer a documented/supported way to prgorammatically load a chart template from NinjaScript. I had a look with the WIndows SDK insepct tool as well to see if we could suggest an AutomationID to hook onto, but there is no Automation ID associated with the Load Template Context menu item.

    We are tracking interest behind the ability to load chart templates programmatically, and I will add a vote on your behalf. The ticket ID is SFT-4761. This is an internal number, but for anyone else wishing to have their interest tracked, please let our support staff know that you would like a vote added for this request.

    Feature Request Disclaimer.

    We receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing.

    When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.

    Release Notes -
    https://ninjatrader.com/support/help...ease_notes.htm

    We look forward to assisting.


    JimNinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Jim View Post
      Hello alligator,

      Thanks for your post.

      We do not offer a documented/supported way to prgorammatically load a chart template from NinjaScript. I had a look with the WIndows SDK insepct tool as well to see if we could suggest an AutomationID to hook onto, but there is no Automation ID associated with the Load Template Context menu item.

      We are tracking interest behind the ability to load chart templates programmatically, and I will add a vote on your behalf. The ticket ID is SFT-4761. This is an internal number, but for anyone else wishing to have their interest tracked, please let our support staff know that you would like a vote added for this request.

      Feature Request Disclaimer.

      We receive many requests and cannot reasonably implement all requested features or changes. Interest is tracked internally and if enough interest is tracked, it would be weighed against how feasible it would be to make those changes to consider implementing.

      When new features are implemented, they will be listed in the Release Notes page of the Help Guide. The ID number will be different than the internal feature request tracking ID, but the description of the feature will let you know if that feature has been implemented.

      Release Notes -
      https://ninjatrader.com/support/help...ease_notes.htm

      We look forward to assisting.

      Great, Jim,

      Meanwhile, is it possible to add or assign a Hot Key to bring up the Templates menu?

      Thanks

      Comment


        #4
        Hello aligator,

        Yes, this is possible. You could consider assigning a Hot Key to Load Templates under Tools > Hot Keys > Global, and then you could use SendKeys to trigger the hot key and open the Load Template window.

        We look forward to assisting.
        JimNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jim View Post
          Hello aligator,

          Yes, this is possible. You could consider assigning a Hot Key to Load Templates under Tools > Hot Keys > Global, and then you could use SendKeys to trigger the hot key and open the Load Template window.

          We look forward to assisting.
          Thanks Jim,

          I have assigned a hot key (alt +T) for Templates/Load that works fine when invoked on keyboard. However, using SendKeys and clicking on the toolbar button will not invoke the Hot Key and nothing will happen.

          I think a part of the Content information that links button to template context menu to trigger the hot key to invoke action is missing in the following code line.


          Code:
           btn = new System.Windows.Controls.Button { Content = ..........., "Template", Style = btnStyle, };
          Any Idea for the missing info for the Content so that a Templates/Load hot key can be triggered to open the Load Template window?

          Many thanks.

          Comment


            #6
            Hello aligator,

            I assigned F2 to the Load Template Hot Key, and I tested the following in State.DataLoaded in a new indicator and I was able to pull up the Load Template menu.

            Code:
            SendKeys.SendWait("{F2}");
            I also downloaded your toolbar script on the User App Share and modified the button press for ArrowUp and I was able to use the toolbar button to invoke the Load Template menu. I do not think modifying the Content property of the button is the issue here. You may have an older version of the script running on the chart or the buttons may have old event handlers attached.

            We look forward to assisting.
            Last edited by NinjaTrader_Jim; 05-29-2020, 09:42 AM.
            JimNinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_Jim View Post
              Hello aligator,

              I assigned F2 to the Load Template Hot Key, and I tested the following in State.DataLoaded in a new indicator and I was able to pull up the Load Template menu.

              Code:
              SendKeys.SendWait("{F2}");
              I also downloaded your toolbar script on the User App Share and modified the button press for ArrowUp and I was able to use the toolbar button to invoke the Load Template menu. I do not think modifying the Content property of the button is the issue here. You may have an older version of the script running on the chart or the buttons may have old event handlers attached.

              We look forward to assisting.
              Thank you so much Jim. You are correct modifying Content was not the issue. I figured out the issue and things work fine.


              The fix was simple but totally strange: Here is what I did to fix the issue for future reference:

              1. Originally I had made a Hot Key as Alt +T (note cap T) for Template/Load and

              2. Used
              Code:
              SendKeys.SendWait("%{T}");
              Issue: Clicking the button did not work to pop up the Templates window

              3. I changed the hot key to a lower cap "t" for SendKeys as
              Code:
              SendKeys.SendWait("%{t}");
              and it Works fine now.

              It is strange because the hot Key assigned is Alt+T but to invoke it I must use %{"t'} for SendKeys.

              Also, strange that the default hot key Alt+S for Save Image does not have this upper/lower cap issue.

              Thanks again.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by cyberpete76, 03-27-2023, 12:29 AM
              7 responses
              265 views
              1 like
              Last Post slightly  
              Started by renewsaltwater, Today, 01:15 AM
              0 responses
              2 views
              0 likes
              Last Post renewsaltwater  
              Started by slightly, Today, 12:49 AM
              0 responses
              3 views
              0 likes
              Last Post slightly  
              Started by sdauteuil, 09-23-2021, 10:16 AM
              4 responses
              1,209 views
              0 likes
              Last Post jacobpescaia44  
              Started by agclub, 04-21-2024, 08:57 PM
              5 responses
              36 views
              0 likes
              Last Post agclub
              by agclub
               
              Working...
              X