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: how to let write related text near contol?

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

    QuantityUpDown: how to let write related text near contol?

    Hello.

    I am often use QuantityUpDown: it is very useful.

    When I trying to add it on ToolBar, or in NTMenuItem I can see only control - no any text tag around.

    If I set Content property - I can't see control but can see this content string.

    So, how to put some text near control (on the left or on the right) and leave control visible and accessible on toolbar and on menus ?

    And have another question: how to set fixed number of digits of shown value?
    ContentStringFormat= "000";
    not work (which is obvious after first question).
    Attached Files
    Last edited by fx.practic; 07-22-2018, 05:55 AM.
    fx.practic
    NinjaTrader Ecosystem Vendor - fx.practic

    #2
    Hello fx.practic,

    Thank you for your note.

    I would suggest downloading the Addon framework at the following link,


    In this sample you’ll see that above the QuantityUpDown control there is TextBlock which acts as a label, “quantity”. You could add a TextBlock next to the QuantityUpDown control.

    To format a value to a specific number of digits you could use,
    Code:
    Double thisNumber = 1.050505;
    Print(thisNumber.ToString("0.00000")); //Will print 5 decimals even if they are all zeros
    Please let us know if you need further assistance.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thanks for clear answer about QuantityUpDown essence, Alan.

      But, under formatting string I mean if I can format exactly QuantityUpDown values?
      For example, to see always 3 digits: 001, 002, 013...
      Last edited by fx.practic; 07-23-2018, 05:06 AM.
      fx.practic
      NinjaTrader Ecosystem Vendor - fx.practic

      Comment


        #4
        Hello fx.practic,

        It would not be possible to modify the QuantityUpDown control, which is probably an int and can't take decimals. I will put in a feature request to be allowed to modify the format.

        You would have to create your own control. I'm unaware of any existing samples which demonstrate how this could be done and this would be out of the scope of what we can support.

        I would suggest searching the net for creating custom updown control in C#, Visual Studio, XAML.

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          Ok, that's clear now. Thank You.
          fx.practic
          NinjaTrader Ecosystem Vendor - fx.practic

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Mongo, Today, 11:05 AM
          4 responses
          14 views
          0 likes
          Last Post Mongo
          by Mongo
           
          Started by traderqz, Today, 12:06 AM
          7 responses
          14 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by Skifree, Today, 03:41 AM
          5 responses
          13 views
          0 likes
          Last Post Skifree
          by Skifree
           
          Started by traderqz, Yesterday, 09:06 AM
          5 responses
          35 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by guillembm, Today, 11:25 AM
          1 response
          6 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X