Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How an indicator can access the Account selected in ChartTrader

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

    How an indicator can access the Account selected in ChartTrader

    Hello!

    What's the NinjaScript statement that lets an indicator query the ChartTrader form and pull the "Account" and "Order qty" field?

    #2
    Hi sbg, thanks for posting.

    The ChartControl Quantity can be accessed by:

    Code:
    ChartControl.Dispatcher.InvokeAsync((Action)(() => { NinjaTrader.Gui.Tools.QuantityUpDown quantitySelector = (Window.GetWindow(ChartControl.Parent).FindFirst(" ChartTraderControlQuantitySelector") as NinjaTrader.Gui.Tools.QuantityUpDown);
    
    quantitySelector.Value = 5; }));
    The selected account can be accessed by:

    Code:
    ChartControl.Dispatcher.InvokeAsync((Action)(() =>
                {
                            //You have to put the stuff below within this ChartC ontrol.Dispatcher.InvokeAsync((Action)(() =>, beca use you are trying to access something on a differ ent thread.
                            xAlselector = Window.GetWi ndow(ChartControl.Parent).FindFirst("ChartTraderCo ntrolAccountSelector") as NinjaTrader.Gui.Tools.Ac countSelector;
                            Print(xAlselector.Selected Account.ToString());
                }));
    Kind regards,
    -ChrisL

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    577 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    334 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X