• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Buttons/Form/Window that interacts with running strategy on chart

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

    Buttons/Form/Window that interacts with running strategy on chart

    Hi,
    I just started to work with NT 8 and so far I really like it.

    What's the best method to implement buttons/form that interacts with running strategy on chart? For example, I open a chart with real-time strategy on it, and I want to pass some parameters/instructions to the strategy while it running.

    I'm not sure if Add-on is the way to go, and if so, how do I start with adding 2-3 buttons that recognizes the running strategy/instrument etc.

    A code sample would be greatly appreciated.

    Thanks a lot.

    #2
    Hello,

    Thank you for the question.

    You can find many examples on the forum currently for the more experimental UI customization and also throughout the help guide.

    For a strategy on a chart, likely you could use the UserControlCollection example from the helpguide to implement WPF controls on a chart: http://ninjatrader.com/support/helpG...ub=usercontrol

    Otherwise you could also see the AddToolbarButton example on the forum: http://ninjatrader.com/support/forum...7&postcount=21

    If you are new to WPF application development the controls may be a bit of a puzzle, if so I would suggest reviewing any WPF tutorials you may locate online as they would likely help regarding user interface items and would not be NinjaTrader specific in most cases.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you! that is amazingly helpful. I'm pretty familiar with WPF, so it's straight forward. It will take some time to digest all the new material and I'm glad you put so much effort in documentation and code samples.

      Comment


        #4
        i am looking for exactly same info except i have no experience with wpf. if there is an example of button interaccting with strategy, it will be great

        Comment


          #5
          Originally posted by junkone View Post
          i am looking for exactly same info except i have no experience with wpf. if there is an example of button interaccting with strategy, it will be great
          You can use the sample in the first link Jesse provided (UserControlCollection). You can just copy it to different places in your strategy code. and it works.

          Comment


            #6
            interesting, i tried and it works. Now how do i remove the control? the control gets added automatically after compilation.

            Comment


              #7
              Originally posted by junkone View Post
              interesting, i tried and it works. Now how do i remove the control? the control gets added automatically after compilation.
              Are you referring to the UserControlCollection example or an addon? The UserControlCollection example should remove the button when the script terminates per its logic.

              Otherwise from an addon you would need to implement logic to remove items on termination yourself.

              I look forward to being of further assistance.
              JesseNinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by fredfred, Today, 03:41 AM
              2 responses
              6 views
              0 likes
              Last Post fredfred  
              Started by TraderYoda, Today, 03:33 AM
              0 responses
              0 views
              0 likes
              Last Post TraderYoda  
              Started by pjsmith, Today, 02:56 AM
              0 responses
              2 views
              0 likes
              Last Post pjsmith
              by pjsmith
               
              Started by ntbone, Yesterday, 08:10 PM
              0 responses
              9 views
              0 likes
              Last Post ntbone
              by ntbone
               
              Started by chrislou, 08-28-2015, 03:27 AM
              14 responses
              2,882 views
              0 likes
              Last Post nkhoi
              by nkhoi
               
              Working...
              X