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

Defaul number in a QuantityUpDown field

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

    Defaul number in a QuantityUpDown field

    Hi!! good Morning!!
    From the forum Example "AddonShell (No tabs)" I would like to know the way to show a different default number (right now is 0) as the window appear after enabling the AddOn in the control center. In this case from 0 to 100...
    Click image for larger version

Name:	220310 a.JPG
Views:	117
Size:	20.9 KB
ID:	1193156Click image for larger version

Name:	220310 b.JPG
Views:	114
Size:	19.6 KB
ID:	1193157

    Thank you
    FVJ

    #2
    Hello efeuvejota01,

    Thanks for your post.

    To change the default number of the QuantityUpDown selector in the AddonShellNoTabs script you would need to modify the XAML file used for the Addon so that it includes a 'Value' parameter.

    You could open the XAML file in a code editor, such as Visual Studio Code, then add the 'Value' parameter for the QuantityUpDown selector. After adding a 'Value' parameter, save the XAML file, then compile the AddonShellNoTabs script in the NinjaScript Editor window for the changes to be made.

    See the code below for an example of what this would look like.

    Code:
    <t:QuantityUpDown x:Name="ExampleQuantityUpDown" [B]Value="100"[/B] Grid.Column="1" Grid.Row="4" Width="120" HorizontalAlignment="Left" VerticalAlignment="Top"/>
    For further information about creating your own Addon, see this help guide documentation: https://ninjatrader.com/support/help...don_window.htm

    Let us know if we may assist further.
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Thank you Brandon!!!
      FVJ

      Comment


        #4
        Hi Brandon:
        I regret to tell you that, at glance it looked it was working OK.But as i was testing, the error arose. The issue is that although in the Addon window it is shown the quantity, Ninjatrader has the number "0" quantity in the variable.
        Let me add some parts of the screenshot.
        Click image for larger version

Name:	220316 b.JPG
Views:	98
Size:	5.1 KB
ID:	1194104
        Click image for larger version

Name:	220316 a.JPG
Views:	109
Size:	9.8 KB
ID:	1194103
        Click image for larger version

Name:	220316 c.JPG
Views:	104
Size:	14.8 KB
ID:	1194105
        Thank you very much!!
        FVJ

        Comment


          #5
          Hello efeuvejota01,

          Thanks for your note.

          This error is likely due to something in your code, such as setting the value of the quantity selector to an invalid value. Debugging steps would need to be taken to determine how the script is behaving and processing values.

          See the attached example script which demonstrates setting a default value of 100 for the quantity selector, QuantityUpDown. In the example script, we print out the value being assigned to the quantity selector which can be seen in a New > NinjaScript Output window.

          Let us know if we may assist further.
          Attached Files
          Brandon H.NinjaTrader Customer Service

          Comment


            #6
            Thank you!! let me see...

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by algospoke, Yesterday, 06:40 PM
            2 responses
            19 views
            0 likes
            Last Post algospoke  
            Started by ghoul, Today, 06:02 PM
            3 responses
            14 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by jeronymite, 04-12-2024, 04:26 PM
            3 responses
            44 views
            0 likes
            Last Post jeronymite  
            Started by Barry Milan, Yesterday, 10:35 PM
            7 responses
            20 views
            0 likes
            Last Post NinjaTrader_Manfred  
            Started by AttiM, 02-14-2024, 05:20 PM
            10 responses
            180 views
            0 likes
            Last Post jeronymite  
            Working...
            X