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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    35 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    12 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    18 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X