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

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:

    JesseNinjaTrader Customer Service

    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:	61
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 fx.practic, 10-15-2013, 12:53 AM
                5 responses
                5,406 views
                0 likes
                Last Post Bidder
                by Bidder
                 
                Started by Shai Samuel, 07-02-2022, 02:46 PM
                4 responses
                98 views
                0 likes
                Last Post Bidder
                by Bidder
                 
                Started by DJ888, Yesterday, 10:57 PM
                0 responses
                8 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by MacDad, 02-25-2024, 11:48 PM
                7 responses
                160 views
                0 likes
                Last Post loganjarosz123  
                Started by Belfortbucks, Yesterday, 09:29 PM
                0 responses
                9 views
                0 likes
                Last Post Belfortbucks  
                Working...
                X