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 rhyminkevin, Today, 04:58 PM
    3 responses
    47 views
    0 likes
    Last Post Anfedport  
    Started by iceman2018, Today, 05:07 PM
    0 responses
    5 views
    0 likes
    Last Post iceman2018  
    Started by lightsun47, Today, 03:51 PM
    0 responses
    7 views
    0 likes
    Last Post lightsun47  
    Started by 00nevest, Today, 02:27 PM
    1 response
    14 views
    0 likes
    Last Post 00nevest  
    Started by futtrader, 04-21-2024, 01:50 AM
    4 responses
    50 views
    0 likes
    Last Post futtrader  
    Working...
    X