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

AddOn Window to appear as part/sub window of the NT8 chart

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

    AddOn Window to appear as part/sub window of the NT8 chart

    Hi Everyone,

    Through NinjaScript code, I have developed an AddOn which successfully adds a button to all NT8 charts main menu on the top. I’m able to achieve that, on any open chart, when this button is clicked by user, a new window (AddOnFrameworkWindow) opens up. It opens as a separate new window.

    Instead of a new window, I need this window to appear as part/subwindow of the chart. In other words, I need this new window to appear inside the chart window/container. Like the chart Trader appears as part of the chart and not as a new window when we press chart Trader On button in NT8 charts main menu. Please guide me how can I do this in my NinjaScript code.

    Below is the code I used in this regard:

    public AddOnFrameworkWindow()
    {
    Caption = "My AddOn";
    Width = 400;
    Height = 400;
    TabControl tc = new TabControl();
    TabControlManager.SetIsMovable(tc, true);
    TabControlManager.SetCanAddTabs(tc, true);
    TabControlManager.SetCanRemoveTabs(tc, true);
    TabControlManager.SetFactory(tc, new AddOnFrameworkWindowFactory());
    Content = tc;
    tc.AddNTTabPage(new NinjaTraderAddOnProject.AddOnPage());

    Loaded += (o, e) =>
    {
    if (WorkspaceOptions == null)
    WorkspaceOptions = new WorkspaceOptions("AddOnFramework-" + Guid.NewGuid().ToString("N"), this);
    };
    }

    #2
    Hello Mubeen Haider,

    Thanks for opening the thread.

    ChartTrader is an extension to the chart window that can be disabled/enabled and hidden. I don't think it will be very easy to create your own extension by injecting your own AddOn window into the chart, since every window tab must be of the same owning window.

    Instead I may suggest that if you create an AddOn that looks at the grid within that chart, checks if your added components are there, and then adds the components to the grid and shifts as needed would be a better way forward to add your own panel of controls to all chart windows.

    My colleague, Chelsea, has some examples that demonstrate modifying the grid elements in a chart so you can add your own panel and your own controls, which should give some direction for how you can accomplish your goal.

    Modifications to chart WPF elements and tab considerations - NinjaTrader Support Forum

    Let us know if there is anything else we can do to help.
    JimNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Rapine Heihei, 04-23-2024, 07:51 PM
    2 responses
    30 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    943 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    9 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by rocketman7, Today, 01:00 AM
    0 responses
    5 views
    0 likes
    Last Post rocketman7  
    Started by wzgy0920, 04-20-2024, 06:09 PM
    2 responses
    28 views
    0 likes
    Last Post wzgy0920  
    Working...
    X