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

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.

    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
    7 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