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 Mindset, 04-21-2026, 06:46 AM
    0 responses
    87 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    133 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    118 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X