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.
        Shows a button on the chart to roll the expiry to the next available contract month. Option to hide button until a number of days before or on roll date. Another option to confirm by opening the instrument overlay selector or automatically rollover without confirmation. (Update June 27th, 2019 – Added an option to show […]
        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 Irukandji, Today, 09:34 AM
                  0 responses
                  3 views
                  0 likes
                  Last Post Irukandji  
                  Started by TraderBCL, Today, 04:38 AM
                  3 responses
                  25 views
                  0 likes
                  Last Post NinjaTrader_Jesse  
                  Started by WeyldFalcon, 08-07-2020, 06:13 AM
                  11 responses
                  1,423 views
                  0 likes
                  Last Post jculp
                  by jculp
                   
                  Started by RubenCazorla, Today, 09:07 AM
                  0 responses
                  4 views
                  0 likes
                  Last Post RubenCazorla  
                  Started by BarzTrading, Today, 07:25 AM
                  2 responses
                  29 views
                  1 like
                  Last Post BarzTrading  
                  Working...
                  X