Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Help with superDOM tab switcher

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

    Help with superDOM tab switcher

    Hello, I started making this code and I need some help filling in the code in some areas please

    basically this code should give me the ability to specifically select 1 of 6 tabs in a superDOM window using a specific hotkey for each tab.

    here’s what I need to know so I can fill in the code better.

    1. I need to identify the method or API that allows me to switch tabs in the SuperDOM window.

    2. Also I need to determine how the tabs are identified or referenced in the SuperDOM window.

    I need to use the identified method or API to switch to the desired tab based on the given tab index or tab name.​

    here is my code so far​

    ```csharp

    region Using declarations

    using System;

    using System.ComponentModel;

    using System.Windows.Input;

    using System.Linq;

    using NinjaTrader.Cbi;

    using NinjaTrader.NinjaScript;

    using NinjaTrader.NinjaScript.Strategies;

    using NinjaTrader.NinjaScript.Indicators;

    #endregion




    namespace NinjaTrader.NinjaScript.Strategies

    {

    public class SuperDOMTabHotkeys : Strategy

    {

    // Strategy parameters

    private string[] instrumentTabs = new string[6] { "Instrument1", "Instrument2", "Instrument3", "Instrument4", "Instrument5", "Instrument6" };




    protected override void OnStateChange()

    {

    if (State == State.SetDefaults)

    {

    Description = @"Assigns hotkey functions to SuperDOM tabs.";

    Name = "SuperDOMTabHotkeys";

    Calculate = Calculate.OnBarClose;

    IsExitOnSessionCloseStrategy = true;

    ExitOnSessionCloseSeconds = 30;

    BarsRequiredToTrade = 0;

    }

    }




    protected override void OnHotKey(HotKeyEventArgs e)

    {

    base.OnHotKey(e);




    // Check if a tab selection hotkey was pressed

    if (e.HotKey.Equals(Key.LeftCtrl | Key.D1))

    {

    ChangeSuperDOMTab(0); // Switch to the first tab

    }

    else if (e.HotKey.Equals(Key.LeftCtrl | Key.D2))

    {

    ChangeSuperDOMTab(1); // Switch to the second tab

    }

    else if (e.HotKey.Equals(Key.LeftCtrl | Key.D3))

    {

    ChangeSuperDOMTab(2); // Switch to the third tab

    }

    else if (e.HotKey.Equals(Key.LeftCtrl | Key.D4))

    {

    ChangeSuperDOMTab(3); // Switch to the fourth tab

    }

    else if (e.HotKey.Equals(Key.LeftCtrl | Key.D5))

    {

    ChangeSuperDOMTab(4); // Switch to the fifth tab

    }

    else if (e.HotKey.Equals(Key.LeftCtrl | Key.D6))

    {

    ChangeSuperDOMTab(5); // Switch to the sixth tab

    }

    }




    private void ChangeSuperDOMTab(int tabIndex)

    {

    if (tabIndex < 0 || tabIndex >= instrumentTabs.Length)

    return;




    string tabName = instrumentTabs[tabIndex];

    SetTab(tabName);

    }




    private void SetTab(string tabName)

    {

    if (tabName.IsNullOrEmpty())

    return;




    foreach (SuperDomWindow superDomWindow in SuperDomWindows)

    {

    SuperDomTab selectedTab = superDomWindow.Tabs.FirstOrDefault(t => t.Header == tabName);

    if (selectedTab != null)

    {

    superDomWindow.SelectedTab = selectedTab;

    break;

    }

    }

    }

    }

    }

    ```

    #2
    Hello Douglee,

    Programmatically changing the selected tab of the SuperDOM would be undocumented and unsupported by NinjaTrader Support.

    A google search shows suggestions of setting the tabControl.SelectedIndex.


    Unfortunately, I do not have further information I am able to provide on this specific task.

    This thread will remain open for any community members that would like to share unsupported code.

    Attached is a script that adds buttons to the SuperDOM WPF and detects the tab selected, but does not trigger the selected tab to change.
    SuperDOMButtonsColumnExample_NT8.zip


    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thank you. Would you happen to have any ideas for me on how I can switch focus between instruments using a hot key so I can trade them? I trade using hot key to execute my orders but I need a way to quickly switch focus to the instrument I want to trade first before I execute my hotkey orders thanks!

      Comment


        #4
        Hello Douglee,

        Unfortunately, there is no functionality to change the instrument with a hotkey.
        The instrument overlay allows you to type a symbol and hit enter while the chart is in focus, but this would be the closest functionality.

        Anything done with custom programming would be undocumented and officially unsupported (but you could choose to implement custom designed unsupported code).

        I would be happy to submit a feature request if you would like our development to consider this functionality for a future release.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Thanks for the reply. If I found someone good at coding you say I could find a way to implement a code to do what I want? It’s at least possible in some way?

          also sure let’s submit a request please.

          my request, also the solution to my problem would be as follows.

          I would like to ability to assign a hotkey function to a individual tabs in the chart window and superDOM window or order entry window.

          this would solve my issue. All I really need is a way to quickly switch instrument focus quickly using a hot key function.
          Last edited by Douglee; 02-01-2024, 11:56 AM.

          Comment


            #6
            Hello Douglee,

            Unfortunately, I wouldn't be able to say. It sounds plausible.

            Once I have a tracking ID for this request I will post in this thread for future reference.
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Hello Douglee,

              This request is being tracked with ID # SFT-6214.

              Please note, 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, so 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 may 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.

              Release Notes - https://ninjatrader.com/support/help...ease_notes.htm
              Chelsea B.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by NullPointStrategies, Yesterday, 05:17 AM
              0 responses
              71 views
              0 likes
              Last Post NullPointStrategies  
              Started by argusthome, 03-08-2026, 10:06 AM
              0 responses
              143 views
              0 likes
              Last Post argusthome  
              Started by NabilKhattabi, 03-06-2026, 11:18 AM
              0 responses
              76 views
              0 likes
              Last Post NabilKhattabi  
              Started by Deep42, 03-06-2026, 12:28 AM
              0 responses
              47 views
              0 likes
              Last Post Deep42
              by Deep42
               
              Started by TheRealMorford, 03-05-2026, 06:15 PM
              0 responses
              51 views
              0 likes
              Last Post TheRealMorford  
              Working...
              X