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 MarianApalaghiei, Today, 10:49 PM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_Manfred  
              Started by love2code2trade, Yesterday, 01:45 PM
              4 responses
              28 views
              0 likes
              Last Post love2code2trade  
              Started by funk10101, Today, 09:43 PM
              0 responses
              8 views
              0 likes
              Last Post funk10101  
              Started by pkefal, 04-11-2024, 07:39 AM
              11 responses
              37 views
              0 likes
              Last Post jeronymite  
              Started by bill2023, Yesterday, 08:51 AM
              8 responses
              46 views
              0 likes
              Last Post bill2023  
              Working...
              X