Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to Find Quantity Value in Chart Trader

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

    How to Find Quantity Value in Chart Trader

    Creating Custom Buttons for Chart Trader.

    How do I find the Quantity that is selected for the Chart/Chart Trader?

    I figured out how to find the selected account, Instrument and ATM Selector for Chart Trader. Using the same approached I can not find the quantity.

    Code:
    AccountSelector accountSelector;
    InstrumentSelector instrumentSelector;
    AtmStrategySelector ATMselector;
    QuantitySelector quantitySelector;
    
    accountSelector = Window.GetWindow(ChartControl.Parent).FindFirst("C hartTraderControlAccountSelector") as AccountSelector;
    instrumentSelector = Window.GetWindow(ChartControl.Parent).FindFirst("C hartWindowInstrumentSelector") as InstrumentSelector;
    ATMselector = Window.GetWindow(ChartControl.Parent).FindFirst("C hartTraderControlATMStrategySelector") as AtmStrategySelector;
    Print(ATMselector.SelectedAtmStrategy.DisplayName. ToString());
    
    quantitySelector = Window.GetWindow(ChartControl.Parent).FindFirst("C hartTraderControlQuantitySelector") as QuantitySelector;
    Print(quantitySelector.ToString());
    I think the code is pretty close. Not sure what to use in print to show the value of the quantity.

    Or should I be using

    Code:
    QuantityUpDown quantitySelector

    #2
    Hello DoctorPurpleApe,

    You can find a sample of getting the quantity here:

    Comment


      #3
      Thank you for the quick response. Works like a charm.

      Comment


        #4
        Hi DoctorPurpleApe and Jesse,
        I'm trying to achieve something similar and run into the problem that I'm unable to use the AtmStrategySelector.
        I'm programming an indicator and have no problem accessing the AccountSelector and QuantityUpdDown, but the AtmStrategySelector appears as an unknown class/type. I guess I'm simply missing a using declaration, but I couldn't find out which. I've also seen AtmStrategy.AtmStrategySelector, but this also does not exist for me.

        Comment


          #5
          Hello Human#102,

          Below are links to forum posts with sample code.
          I am having an issue extracting the atm strategy name from the chart trader. I know I can make my own listbox in the parameter listing, but I want to extract it from the chart trader instead of opening it everytime. How od Iget the contract quantity and the strategy name in order to create my order? int nContractQuantity =

          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hi Chelsea B.
            Thanks for the response, it helped me solve some other issues I had, but doesn't address the main problem I've asked about.
            `AtmStrategySelector` appears for me not as an existing type. I can't find it or something similar under `NinjaTrader.Gui.Tools` or anywhere else. The account or quantity selector classes are working properly in my code but none of the solutions I've found enabled me to access the atm selector. It's as if there isn't any class for it, even if I use any provided example scripts.
            Shouldn't it for example show up here:
            Click image for larger version

Name:	image.png
Views:	259
Size:	43.0 KB
ID:	1284133

            Comment


              #7
              Hello Human#102,

              NinjaTrader.Gui.NinjaScript.AtmStrategy.AtmStrateg ySelector
              Chelsea B.NinjaTrader Customer Service

              Comment


                #8
                Thank you very much!

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                648 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
                574 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X