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:	38
Size:	20.9 KB
ID:	1193156Click image for larger version

Name:	220310 b.JPG
Views:	34
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" Value="100" 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:	20
Size:	5.1 KB
ID:	1194104
        Click image for larger version

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

Name:	220316 c.JPG
Views:	21
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 309338, Today, 12:06 PM
            0 responses
            6 views
            0 likes
            Last Post 309338
            by 309338
             
            Started by AaronKoRn, Yesterday, 08:38 PM
            2 responses
            51 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by rocketstock, 08-05-2022, 09:36 PM
            2 responses
            75 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by ronyggg83, Yesterday, 03:48 PM
            4 responses
            52 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by preqc, 08-05-2022, 09:10 AM
            1 response
            36 views
            0 likes
            Last Post NinjaTrader_Jim  
            Working...
            X