• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Account Info - PNL - STRATEGY NAME - Info Box

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

    Account Info - PNL - STRATEGY NAME - Info Box

    Do you have any sample code for having a small tool/info box on the chart when a strategy is loaded? I want to have a toolbox that shows pnl and some other info. But i can't seem to find any reference for me to build upon. Not an expert at code but i can make do if i can reference some samples.

    #2
    Hello priceisking,

    Thank you for the post.

    Generally, the most simple ways to create some kind of display or interface would be rendering it. If you only need values displayed on the chart and nothing interactive (buttons) I would suggest looking at the SampleCustomRender indicator. You can also use drawing tools to display text or items on the chart, however, it would be hard to make a panel or box type display with drawing tools.

    If you wanted to make a more advanced display or require GUI elements that are interactive (buttons), NT8 uses C# and WPF for its window framework so a lot is possible in regard to creating custom elements. I believe from what you have posted this is likely outside of the scope of what you wanted, so I just wanted to mention this is also possible.

    If you can let me know if you needed interactive elements or not, I may be able to provide other samples/guides toward that route.

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

    Comment


      #3
      I would like to both. Initially I want to use some drawing tools to display text on the chart of things like PNL, current Realized profit, unrealized , position open etc..
      Once i get the hang of coding that, i would like to see some examples of GUI elements such as button on the chart etc.. If you can provide link to both that would be great. I have the weekend to explore thank you so much.

      Comment


        #4
        Hello priceisking,

        Thank you for clarifying that.

        Drawing tools are a good place to start because they are quick and easy to use. These are really good for development and specific use cases so I would suggest using drawing tools as you go to help guide your development and for debugging purposes. It does sound like you also want some more advanced options as well so the SampleCustomRender or using "OnRender" for rendering would be the next step up for creating the custom drawings. The SampleCustomRender demonstrates most of the basics rendering concepts so this would be a good place to learn about creating custom drawings.

        For creating even more advanced displays, you can use the UserControlCollection which is a bridge between full UI development and NinjaScript: https://ninjatrader.com/support/help...ub=usercontrol

        Beyond that is standard WPF C# development, we do have a lot of samples surrounding these concepts however it is best if you learn some general C# wpf development outside of NinjaTrader first for these items. The Addon section of the help guide would be the best place to start for this concept: https://ninjatrader.com/support/help...t_overview.htm We also have some samples of creating toolbars and panels here: https://ninjatrader.com/support/foru...ons#post499327

        With that being said, there is really nothing stopping you from using all of these concepts however you wish, so you can combine these types of development to make the display in a format you like. I would highly suggest using the forum for UI development questions as there are a huge number of samples spread across the forum for many concepts.

        The education section in the help guide also has a large number of help articles for various concepts including rendering or GUI development: https://ninjatrader.com/support/help..._resources.htm


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

        Comment


          #5
          Thank you for the detail information. I will go through all of this. Appreciate the quick response.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Ilpropio, Yesterday, 09:45 PM
          1 response
          4 views
          0 likes
          Last Post NinjaTrader_EricB  
          Started by sgordet, Yesterday, 10:31 PM
          1 response
          2 views
          0 likes
          Last Post NinjaTrader_EricB  
          Started by Revan, Yesterday, 05:44 PM
          1 response
          14 views
          0 likes
          Last Post NinjaTrader_Marco  
          Started by superg3, Yesterday, 07:57 PM
          0 responses
          4 views
          0 likes
          Last Post superg3
          by superg3
           
          Started by Longhornmark, Yesterday, 07:06 AM
          5 responses
          36 views
          0 likes
          Last Post nkhoi
          by nkhoi
           
          Working...
          X