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 to change the time interval from under the hotkey

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

    Command to change the time interval from under the hotkey

    There is a task to change the time interval from under the hotkey, the hotkey code is below, which command and the correct syntax can be used for this task

    Code:
     public void OnKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
    {
    if (e.Key == Key.LeftCtrl)
    {
    ctrl = true;
    }
    
    if (e.Key == Key.B)
    {
    one = true;
    }
    
    if (ctrl && one)
    {
    Print("TimeFrame - 1M");
    
    // TImeFrame Logic
    }
    }

    #2
    I have tried SendKeys

    SendKeys.Send("{1M}");

    not working

    Comment


      #3
      I solved the problem myself.

      However, there was a question about the operation of the button itself (hotkey)

      The fact is that hot keys work ONLY if First mouse button is pressed on the chart itself, and then the key will work 1 time, for the second time you need to press the left mouse button again anywhere on the chart, then the combination of buttons will work again,
      and so is constant.

      Hotkeys do not work without clicking the mouse on the chart First.

      What could be the problem?

      Comment


        #4
        Hello memonolog,

        Changing data series information from code is officially not supported by NinjaTrader and is intentionally not documented.

        However, it is possible to do. The RolloverIndications indicator uses this to send the next expiry to the instrument overlay selector.
        https://ninjatraderecosystem.com/use...indications-2/
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_ChelseaB View Post
          Hello memonolog,

          Changing data series information from code is officially not supported by NinjaTrader and is intentionally not documented.

          However, it is possible to do. The RolloverIndications indicator uses this to send the next expiry to the instrument overlay selector.
          https://ninjatraderecosystem.com/use...indications-2/
          I implemented this task, the question remains why the keys do not work without pressing the mouse button on the chart

          However, there was a question about the operation of the button itself (hotkey)

          The fact is that hot keys work ONLY if First mouse button is pressed on the chart itself, and then the key will work 1 time, for the second time you need to press the left mouse button again anywhere on the chart, then the combination of buttons will work again,
          and so is constant.

          Hotkeys do not work without clicking the mouse on the chart First.

          What could be the problem?

          Comment


            #6
            Hello memonolog,

            The window needs to have focus for any user events to be routed to it.

            There may be an unsupported way to get the user events from all windows, but I wouldn't have any examples or further information.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              It would be great to be able to assign custom hotkeys to time frames, you are left out if you use Heiken Ashi or Renko charts. Thanks for considering it! Even if it works with normal candles, entering 5M or 1D in the chart is a little bit tedious and counter-intuitive I find.

              Comment


                #8
                Hello RT001,

                We have added your suggestion to our list of requested Hot Key enhancements. These enhancements are tracked under the internal ticket ID SFT-2386. 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 specifically for changing BarsTypes and time frames.

                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. As such we cannot offer an ETA or promise of fulfillment.

                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.
                JimNinjaTrader Customer Service

                Comment


                  #9
                  Awesome, many thanks Jim!

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by KirkHammett, Today, 03:23 AM
                  0 responses
                  2 views
                  0 likes
                  Last Post KirkHammett  
                  Started by eleven, Yesterday, 10:06 PM
                  0 responses
                  35 views
                  0 likes
                  Last Post eleven
                  by eleven
                   
                  Started by ezrollin, Yesterday, 08:12 PM
                  7 responses
                  72 views
                  0 likes
                  Last Post bltdavid  
                  Started by kyamato, 11-23-2021, 10:51 PM
                  6 responses
                  91 views
                  0 likes
                  Last Post jeronymite  
                  Started by fscabrera03, Yesterday, 07:14 PM
                  0 responses
                  49 views
                  0 likes
                  Last Post fscabrera03  
                  Working...
                  X