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

QuantityUpDown Control

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

    QuantityUpDown Control

    In an AddOn, using the QuantityUpDown control is very handy. Thanks!

    Some questions:
    • Why does the value of a QuantityUpDown control with a value of zero oscillate between values of zero and 1 when the down-arrow is clicked successively?
    • In the Basic Entry window, the QuantityUpDown control defaults to various quantity increments for different instruments. How may one obtain the same functionality using a QuantityUpDown control in an AddOn?
    • Setting the Instrument property of the control does not seem to have a useful effect. In fact, when set, it seems to make using the control problematic in that choosing a selectable value from the "calculator" will select that value and allow one to increment/decrement it; but once at a value of 1, it seems to prevent any further increment/decrement. If one does not set the Instrument property, any value can be selected and increment/decrement work as expected. Is this what one should expect?
    Thanks.
    Multi-Dimensional Managed Trading
    jeronymite
    NinjaTrader Ecosystem Vendor - Mizpah Software

    #2
    Hi jeronymite

    I'm trying to play also with the QuantityUpDown Control in the DOM, in that case in the limit orders that one can use in level 2 cells. I'm not able to find how to access this area. I ask you because seems you are playing with similar controls and maybe can help me to find them. Here is my question to NinjaTrader:

    Hi Team, I'm a little lost trying to find the automation ID, or how to access the price levels on the DOM and the quantity up/down in limit orders at the DOM. In the Chart Trader was easy to find the Automation ID, but at the DOM I'm not able to find it. All that I try was failed. See attached pictures... What I need is to


    but si out of support and maybe you or another member can help me to find this.

    Thank you so much

    Comment


      #3
      Hello jeronymite,

      I am not able to reproduce this behavior with a test script.

      Quantities should be whole numbers.. Are you wanting decimal values for the quantity?



      Are finding this test attached script is reproducing the behavior on your end?
      Attached Files
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hi Chelsea. Couldn't find a test script in your response. Nevertheless, I have seen the AddOnFramework example demonstrate the 0/1 oscillation.

        Not wanting decimal numbers, just whole integers. But would like the "predefined" values based on Instrument type that happen in Basic Entry.

        Thanks.
        Multi-Dimensional Managed Trading
        jeronymite
        NinjaTrader Ecosystem Vendor - Mizpah Software

        Comment


          #5
          Hello jeronymite,

          Apologies for not attaching the script. Post above has been edited.

          I think I am understanding the issue, the quantity should always be 1 or greater and clicking the down arrow is able to set this to 0 which would be an invalid quantity. Further, when 0 and clicking down it sets it to one.

          I will submit a feature request for QuantityUpDowns to not allow a value below 1 when clicking the down arrow.

          As far as setting a default value based on the instrument type, you could check the instrument type.
          Code:
          For example:
          if (Instrument.MasterInstrument.InstrumentType == InstrumentType.Stock)
          {
          myQuantityUpDown.Value = 100;
          }
          Last edited by NinjaTrader_ChelseaB; 11-02-2020, 10:40 AM.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hello jeronymite,

            I found there is a <QuantityUpDown>.Minimum that can be set to prevent the quantity from having a value of less than 1.

            For example:
            Code:
            myQuantityUpDown.Value = 1;
            myQuantityUpDown.Minimum = 1;
            Chelsea B.NinjaTrader Customer Service

            Comment


              #7
              Thanks, Chelsea. I appreciate you looking into this. Your observations are helpful.

              What is the purpose of the Instrument property of the QuantityUpDown control? And why does the Value essentially freeze at 1 when an Instrument is set?

              Thanks.
              Multi-Dimensional Managed Trading
              jeronymite
              NinjaTrader Ecosystem Vendor - Mizpah Software

              Comment


                #8
                Hello jeronymite,

                I don't think the Instrument has a purpose for addon scripts and may be used for something in the core code.

                I am not able to reproduce freezing.

                Below is a link to a video.
                Chelsea B.NinjaTrader Customer Service

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by bortz, 11-06-2023, 08:04 AM
                47 responses
                1,607 views
                0 likes
                Last Post aligator  
                Started by jaybedreamin, Today, 05:56 PM
                0 responses
                9 views
                0 likes
                Last Post jaybedreamin  
                Started by DJ888, 04-16-2024, 06:09 PM
                6 responses
                19 views
                0 likes
                Last Post DJ888
                by DJ888
                 
                Started by Jon17, Today, 04:33 PM
                0 responses
                6 views
                0 likes
                Last Post Jon17
                by Jon17
                 
                Started by Javierw.ok, Today, 04:12 PM
                0 responses
                15 views
                0 likes
                Last Post Javierw.ok  
                Working...
                X