• 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

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, 09: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 MARTIN MARTIN, Today, 01:01 PM
                      0 responses
                      4 views
                      0 likes
                      Last Post MARTIN MARTIN  
                      Started by bouncetherubble, Today, 10:21 AM
                      2 responses
                      10 views
                      1 like
                      Last Post bouncetherubble  
                      Started by tcbarrow, Today, 10:53 AM
                      1 response
                      11 views
                      0 likes
                      Last Post NinjaTrader_ChelseaB  
                      Started by dmking, Today, 11:31 AM
                      2 responses
                      15 views
                      0 likes
                      Last Post dmking
                      by dmking
                       
                      Started by TazoTodua, Yesterday, 03:01 PM
                      4 responses
                      27 views
                      0 likes
                      Last Post koganam
                      by koganam
                       
                      Working...
                      X