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

Xaml

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

    Xaml

    Hello,

    After referring to the following threads....




    I can't seem to find any documentation on using XAML with NT8. Was this ever produced? If so, where might I be able to locate it?

    #2
    Hello,

    Thank you for the post.

    While we do have some general documentation on the NinjaTrader specific XAML controls you can use, we do not have an overall xaml documentation as this is a general programming concept similar to C#. Microsoft specifically has excellent documentation that covers XAML as a total subject, you can locate information here:
    Learn how the XAML language is structured and implemented by Windows Presentation Foundation (WPF) for .NET.

    Follow this tutorial to learn how to create a new WPF app for .NET with Visual Studio 2019.



    For NinjaTrader specific controls you can see the following resources:


    There is a full addon example that includes the NinjaTrader XAML controls and shows their useages here:


    In general XAML is best learned outside of NinjaTrader by creating a WPF application in Visual Studio. Because this is another language this is basically the same concept as learning C#. There are some resources provided by NinjaTrader that would relate to NinjaTrader specifically but to really learn the language I would suggest to revert to general C# WPF design tutorials as these would explain this concept in much greater detail.

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

    Comment


      #3
      Thanks for the prompt reply, Jesse.

      This is great information. To expand on my initial inquiry, I was more concerned with how to get NT8 to use XAML. Thank you for pointing me to the AddOn Section of the helpguide. After referring to it, the conclusion I came to was that I would have to use an IDE to build a DLL. There seems to be no other way around it.

      Also, I am not creating an AddOn which is why I didn't focus on this section of the help guide. For documentation/reference purposes, the team might consider creating another Educational Resource Article that educates the novice on using XAML files (specifically with charts) in NT8.

      There are those of us who desire to use the chart window instead of developing an AddOn and would much rather do so with XAML instead of writing lines upon lines of C# code. Just a thought.

      Comment


        #4
        Hello,

        Thank you for the reply.

        To expand on what the help guide has documented, you can create an addon that is its own window, or you can expand existing windows using an addon. An example would be adding tools to a chart window.

        Because you are using WPF you can use the standard WPF techniques to insert controls or load/parse xaml code into controls that can be inserted. The way this all occurs would mostly be up to you and how you want to implement your tool. The addon framework just gives you an observational standpoint to see other windows and affect them or gives the means to create an entirely new tool.

        Please see the following example of adding a button to a chart from an addon, this could be exported as a dll if you wanted to distrubute it but otherwise does not require anyhting but the NinjaScript editor.


        The following is also helpful in finding control automation ids, these ids are used to find an instance of a control within the visual tree of a control: http://ww.ninjatrader.com/support/fo...44&postcount=7

        Please let me know if I may be of additonal assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Jesse,

          Thanks for the information about the inspect tool--that was really helpful.

          However, your sample script is an addon that will add an "Example Button" to every chart window that gets created.

          As I mentioned previously, I am NOT developing an addon. Fortunately, I was able to glean some useful information from the "Addon Development Overview" article. But to limit this information to that section is a bit narrowly focused in my opinion.

          I and others would simply like to enhance our custom indicators/strategies which may involve:
          • adding buttons to the main toolstrip
          • creating a separate toolstrip
          • creating an entirely new panel
          • etc.


          Of course, all of this can be coded in C# within the Ninjascript Editor but it means typing 2-3x the amount of code compared to that needed using XAML. And, to my understanding, I can't just simply drop XAML code into the Ninjascript editor.

          After doing a little more reading, I think I understand your load/parse comment. BUT, if you would like to explain further for the sake of the thread, feel free.

          In any event, my original post was simply an inquiry about using XAML with NT8. For my case, I think I have come to the conclusion what needs to be done. As for other novice developers, I am not so sure the answer is clear.

          I appreciate your help on this topic.

          Comment


            #6
            Hello,

            Thank you for the reply.

            However, your sample script is an addon that will add an "Example Button" to every chart window that gets created.
            Yes, this is correct, if you wanted to modify all windows this would be the approach otherwise you could implement some type of filtering if a chart with X indicator is only to be used. This is really up to your design and how you feel the tool needs to work. "Addon" is a generalized term, this is simply the name of the type being used, what you make the addon type do is largely up to you and your goals.

            Regarding XAML loading, again this is also largely up to you and how you want to append your items into the platform. Some users do like to use XAML so they may parse existing XAML into elements and append them like the addon sample in the help guide. Other may not and would instead programmatically append items, both are valid approaches and would be a preference. This would really depend on your experience with WPF and XAML and what is best for your specific goal.

            The Addon window example in the help guide is a good example of loading and parsing a XAML page. If you would like a better explanation of my parsing comment, this example can demonstrate this concept in full detail. This sample can be used as a guide for use in your own scripts whether that be an indicator or an addon, the type really doesn't matter just that you parse an existing XAML file/text into an object and then do something with that object.

            The addon section of the help guide does leave a lot of questions and really only targets specific concepts that we have created specifically. This leaves a lot of room for you to explore and is certainly not targeted at novice developers. The addon framework is more or less only that, a framework you can build on top of.

            For developers who want to create custom tools or modifications to existing tools, this is the suggested approach due to being able to observe the other tools in the platform or modify them. Because of the nature of this subject, this also entails that the developer is already knowledgeable with NinjaScript concepts along with common C#/XAML/WPF concepts. We do provide complete examples/projects for addon development to help get new developers started but in the end, it would be up to the developer to expand their knowledge on these programming topics if needed to accomplish the tasks they want to complete.

            Please let me know if I may be of further assistance.
            JesseNinjaTrader Customer Service

            Comment


              #7
              We do provide complete examples/projects for addon development to help get new developers started
              Can you please provide a link to the sample projects? The piecemeal code in the Add-On documentation is very hard to follow.

              Comment


                #8
                Hello,

                Thank you for the post.

                The sample links were actually posted in reply #2 of this thread, here are the links again:

                There is a full addon example that includes the NinjaTrader XAML controls and shows their usage here:


                In that documentation, specifically the files:
                Download AddOn Framework NinjaScript Basic file to your desktop
                and
                Download Visual Studio Solution for AddOn Development



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

                Comment


                  #9
                  Jesse,

                  On this post, reply #7 you have two link two two different posts. The second one is not working. This is the link that you provided and which is not working:


                  Could you fix the link so that I can see the sample which you are referring too.

                  Thank,

                  Comment


                    #10
                    Hello GARZONJ,

                    Thank you for your reply.

                    The link that you've provided was just missing a w in the www. part. Here's the post it goes to:



                    Please let us know if we may be of further assistance to you.
                    Kate W.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by samish18, Yesterday, 08:31 AM
                    4 responses
                    14 views
                    0 likes
                    Last Post elirion
                    by elirion
                     
                    Started by funk10101, Yesterday, 09:43 PM
                    1 response
                    13 views
                    0 likes
                    Last Post NinjaTrader_Gaby  
                    Started by TheWhiteDragon, 01-21-2019, 12:44 PM
                    5 responses
                    551 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by rtwave, 04-12-2024, 09:30 AM
                    5 responses
                    37 views
                    0 likes
                    Last Post NinjaTrader_ChelseaB  
                    Started by funk10101, Today, 12:02 AM
                    1 response
                    11 views
                    0 likes
                    Last Post NinjaTrader_LuisH  
                    Working...
                    X