Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Reload Ninjascript via code

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

    Reload Ninjascript via code

    Hallo,

    I wonder if there is a way to do a "reload ninjascript" (F5) on a chart programatically?

    For a number of reasons, I sometimes need to do it on my charts, but to do it manually is virtually impossible, any suggestions on how to achieve this via code?

    Thanks.

    Juan

    #2
    Hi Juan,

    Unfortunately there is no supported technique for calling Reload NinjaScript programatically. Thank you for the suggestion. We have added this to our internal feature tracking system with ID # 830.
    Last edited by NinjaTrader_RyanM1; 04-04-2011, 10:03 AM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Ok.

      Hopefully this gets implemented soon....

      Meanwhile, someone has any hints on any unsupported technique???

      Thanks

      Juan

      Comment


        #4
        Originally posted by jriverac View Post
        Hallo,

        I wonder if there is a way to do a "reload ninjascript" (F5) on a chart programatically?

        For a number of reasons, I sometimes need to do it on my charts, but to do it manually is virtually impossible, any suggestions on how to achieve this via code?

        Thanks.

        Juan
        Take a look at this thread: http://www.ninjatrader.com/support/f...hlight=refresh

        Comment


          #5
          You can use the SendKeys() function in C#, and "send" and F5.
          mrlogik
          NinjaTrader Ecosystem Vendor - Purelogik Trading

          Comment


            #6
            yes , I am also using SendKeys in several occasions including reload ninjascript.
            It is working, but take care of Focus and such. Sometimes you must run a background thread with SendKeys()

            regards
            andreas www.zweisteintrading.eu

            Comment


              #7
              Thank you all for the help!!!

              You pointed me on the right direction, I tested it on one chart and it worked!!!

              But, now I am worried about the focus if I apply this technique to a few charts... will it work? How can I assure that each chart has the focus when the F5 is sent? Any hints?

              Thanks again!!

              Juan

              Comment


                #8
                I use the SendKeys() method as described, but my concern is that this hot key can be changed by the user.

                I've used other SendKeys() in the past, but I've stopped and instead "clicked" (from within the code) the tools from the chart's toolbar. Unfortunately, there is no "refresh chart" anywhere on the toolbar for me to "click".

                Has anyone come up with a better way to do this from within code?

                Thanks!
                Daniel

                Comment


                  #9
                  Originally posted by neoikon View Post
                  I use the SendKeys() method as described, but my concern is that this hot key can be changed by the user.

                  I've used other SendKeys() in the past, but I've stopped and instead "clicked" (from within the code) the tools from the chart's toolbar. Unfortunately, there is no "refresh chart" anywhere on the toolbar for me to "click".

                  Has anyone come up with a better way to do this from within code?

                  Thanks!
                  Daniel
                  You can add your own button to the toolbar via ChartControl.

                  But, you'd have to map that callback to the SendKeys

                  Comment


                    #10
                    Originally posted by sledge View Post
                    You can add your own button to the toolbar via ChartControl.

                    But, you'd have to map that callback to the SendKeys
                    Right, that's exactly what I have, a toolbar with buttons, one of which performs some actions, then performs an "F5" to reload the chart. I am just looking for a way to NOT use SendKeys() due to the requirement that the hot key remains unchanged.

                    Daniel

                    Comment


                      #11
                      Originally posted by neoikon View Post
                      Right, that's exactly what I have, a toolbar with buttons, one of which performs some actions, then performs an "F5" to reload the chart. I am just looking for a way to NOT use SendKeys() due to the requirement that the hot key remains unchanged.

                      Daniel
                      Try using ChartControl() and Invalidate() the client rectangle.

                      Comment

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by CortexZenUSA, Today, 12:53 AM
                      0 responses
                      1 view
                      0 likes
                      Last Post CortexZenUSA  
                      Started by CortexZenUSA, Today, 12:46 AM
                      0 responses
                      1 view
                      0 likes
                      Last Post CortexZenUSA  
                      Started by usazencortex, Today, 12:43 AM
                      0 responses
                      5 views
                      0 likes
                      Last Post usazencortex  
                      Started by sidlercom80, 10-28-2023, 08:49 AM
                      168 responses
                      2,266 views
                      0 likes
                      Last Post sidlercom80  
                      Started by Barry Milan, Yesterday, 10:35 PM
                      3 responses
                      13 views
                      0 likes
                      Last Post NinjaTrader_Manfred  
                      Working...
                      X