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: negative value

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

    QuantityUpDown: negative value

    Hello.
    I using QuantityUpDown control and found out, that it don't show negative value.

    I overrideValueChanged() event handler.
    When value is zero and down arrow pressed, ValueChanged() invokes and QS.Value == -1.

    But, after that, ValueChanged() invokes once more and QS.Value become 0.

    I checked QS.Minimum value - it equals to Int32.MinValue;

    I tried override event handlers, that may reset value to zero, but it not helps:
    PHP Code:
    QS.TouchDown +=  (oe) =>    {};
    QS.PreviewMouseDown +=  (oe) =>    {}; 
    How to let QS.Value to remain negative?
    Last edited by fx.practic; 09-16-2017, 12:04 AM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello,

    Thank you for the post.

    I wanted to check, do you have a sample you can export that shows what you are currently trying in regards to the negative not being set?

    Also, does this only occur with pressing the buttons or can you type a negative in?

    I would need to research this further as this is a ninjatrader control to see if this has some logic that sets a minimum.

    With a sample of what you are trying, I could provide that with my question to development to advance the question faster.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank You for fast answer.

      Here is video: https://monosnap.com/file/lamiCueGb8...n02ITzoNWETSk3
      I just using mouse clicking on up \ down arrows.

      Indicator in attachment.
      Attached Files
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Hello, are there any news from development?
        fx.practic
        NinjaTrader Ecosystem Vendor - fx.practic

        Comment


          #5
          Hello,

          Thank you for posting the sample that was helpful.

          After further review of the QuantityUpDown control it looks like it has a nice property to allow negatives:

          IsNegativeValueAllowed = true

          Code:
          Quantity_Selector = new NinjaTrader.Gui.Tools.QuantityUpDown
          {
          	IsNegativeValueAllowed = true
          };
          I look forward to being of further assistnace.
          JesseNinjaTrader Customer Service

          Comment


            #6
            That is definitely work, thank You very much!!!
            Last edited by fx.practic; 09-18-2017, 09:02 AM.
            fx.practic
            NinjaTrader Ecosystem Vendor - fx.practic

            Comment


              #7
              Once more question: how to set negative increment options here (please, look at screenshot).

              I tried to set IsNegativeValueAllowed = true;, but it not helps.
              Attached Files
              Last edited by fx.practic; 03-03-2018, 10:28 AM.
              fx.practic
              NinjaTrader Ecosystem Vendor - fx.practic

              Comment


                #8
                Hello,

                Thank you for the question.

                I believe you are looking for the LotSize property on the QuantitySelector:

                Code:
                Quantity_Selector = new NinjaTrader.Gui.Tools.QuantityUpDown
                {
                	IsNegativeValueAllowed = true, LotSize = 10
                };
                
                //sometime later, likely while using a dispatcher
                
                Quantity_Selector.LotSize = 20;
                This would increment by 10, or later it could be reset and increments by 20 in this example.

                Additionally, If you are referring to the list you have, I would need to see a sample of what you have created there to further assist with those controls.

                I look forward to being of further assistance.
                JesseNinjaTrader Customer Service

                Comment


                  #9
                  Thank You, Jesse.

                  LotSize was helpful: I made context menu that change it.


                  But, I mean if can I use built-in mechanism for negative increments:

                  Free online storage and sharing with Screencast.com. 2 GB of storage and 2 GB of bandwidth per month for free. We won't compress, alter or take ownership of your content.
                  fx.practic
                  NinjaTrader Ecosystem Vendor - fx.practic

                  Comment


                    #10
                    Hello,

                    Thank you for the reply.

                    If you are referring to the additional QuantitySelector you have created in the extra window, again I would need to see an example of what you are doing there as that is more than just the QuantitySelector we were talking about.

                    If that control in the video is specifically a QuantitySelector, you should be able to apply the same properties to it to have it use negative values or increment in a specific way.

                    I look forward to being of further assistance.
                    JesseNinjaTrader Customer Service

                    Comment


                      #11
                      In attachment - indicator that add standard QuantityUpDown control on toolbar.
                      One only modification: IsNegativeValueAllowed = true

                      Is it possible to predd middle mouse button and to add negative increment values?
                      Attached Files
                      fx.practic
                      NinjaTrader Ecosystem Vendor - fx.practic

                      Comment


                        #12
                        Hello,

                        Thank you for the reply.

                        I am not certain I understand the question from what has been provided.

                        In the video, it looks like you are opening a new window and asking about that, but this sample does not contain any of what was show and only the quantity selector.

                        I see that what you have provided does work going negative, and also works while using the middle mouse wheel and also if I add C.Qud.LotSize = 10 the incrementing works.

                        Can you clarify what the question is surrounding the sample iQuantityUpDown_Negative_Increment.cs?

                        I look forward to being of further assistance.
                        JesseNinjaTrader Customer Service

                        Comment


                          #13
                          Hello.
                          Please, look at screenshots.
                          I want to add negative increment in this table.
                          Attached Files
                          fx.practic
                          NinjaTrader Ecosystem Vendor - fx.practic

                          Comment


                            #14
                            Hello,

                            Thank you for clarifying that for me.

                            I will need to research this further to see if this would be possible. Once I have more details I will reply back here.

                            I look forward to being of further assistance.
                            JesseNinjaTrader Customer Service

                            Comment


                              #15
                              Thank You.

                              I am understand, that QuantityUpDown control was designed exceptionally for set lot value purposes.
                              And still, I have to mention these:

                              1) user may have need to decrease lot size;
                              2) control is very useful for dozens other purposes.

                              And control is very convenient to use.

                              So, I am sure, negative values needed.
                              Last edited by fx.practic; 03-08-2018, 07:33 AM.
                              fx.practic
                              NinjaTrader Ecosystem Vendor - fx.practic

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by Mindset, 05-06-2023, 09:03 PM
                              9 responses
                              258 views
                              0 likes
                              Last Post ender_wiggum  
                              Started by Mizzouman1, Today, 07:35 AM
                              4 responses
                              18 views
                              0 likes
                              Last Post Mizzouman1  
                              Started by philmg, Today, 01:17 PM
                              1 response
                              6 views
                              0 likes
                              Last Post NinjaTrader_ChristopherJ  
                              Started by cre8able, Today, 01:01 PM
                              1 response
                              8 views
                              0 likes
                              Last Post NinjaTrader_ChelseaB  
                              Started by manitshah915, Today, 12:59 PM
                              1 response
                              5 views
                              0 likes
                              Last Post NinjaTrader_Erick  
                              Working...
                              X