Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get and Set values from ChartTrader using a Drawing tool

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

    Get and Set values from ChartTrader using a Drawing tool

    Hello,

    Hello, I am developing a new drawing tool where I require access to the NinjaTrader.Gui.Tools.QuantityUpDown and NinjaTrader.Gui.Tools.AccountSelector

    How can actually have access to it from a Drawing Tool? I tried adding it and won't work vs when adding the same snippet from an Indicator works

    Code:
    NinjaTrader.Gui.Tools.AccountSelector selector;
    selector = Window.GetWindow(ChartControl.Parent).FindFirst("C hartTraderControlAccountSelector") as NinjaTrader.Gui.Tools.AccountSelector;
    Print(selector.SelectedAccount.ToString());
    
    NinjaTrader.Gui.Tools.QuantityUpDown quantitySelector = (Window.GetWindow(ChartControl.Parent).FindFirst(" ChartTraderControlQuantitySelector") as NinjaTrader.Gui.Tools.QuantityUpDown);
    quantitySelector.Value = 10;
    Regards,
    ale

    #2
    Hello alejandro888,

    Thanks for your message.

    I tested this in a DrawingTool, and the snippet works in OnRender as long you use chartControl as opposed to ChartControl. There were some extra spaces where your automation ID strings are, I am not sure if that was a leftover from copying to the forum or possibly a leftover from the forum copied to your script. With the spaces removed and chartControl used, the test works fine.

    If there is any other insight I can share, please let me know.

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    647 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    369 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    108 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    572 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    573 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X