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

Add Calculated Values Under ChartTrader Bid/Ask Display

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

    Add Calculated Values Under ChartTrader Bid/Ask Display

    Hello community,

    The title is pretty self-explanatory, I would like to add two int values, "long risk" and "short risk" that update on each tick to the chart trader display under the bid/ask display. Right now they are displayed as text overlaying the chart in the corner and I think this new way would look cleaner.

    How would I approach this? I was thinking NT_Chelsea's indicator which adds buttons to chart trader would be a good place to start, but I don't know anything about how the Bid/Ask display is coded seeing as the code for chart trader is not public.

    Any point in the right direction, or specific instructions would be greatly appreciated, thank you!

    #2
    Hello lunardiplomacy,

    Thanks for your post.

    A TextBlock is used. I may encourage you to use Intellisense/Intelliprompt and to check System.Windows.Controls to see available WPF Controls and to experiment with using those controls so you become more familiar with them in your custom works.

    Publicly available information can be found below

    TextBlock - https://docs.microsoft.com/en-us/dot...orkdesktop-4.8

    WPF Controls - https://docs.microsoft.com/en-us/dot...orkdesktop-4.8

    I have also attached a modification which adds a TextBlock.

    Let us know if there is anything else we can do to help.
    Attached Files
    JimNinjaTrader Customer Service

    Comment


      #3
      Hi, how do you display variables the same way the grid below displays bid and ask prices or calculation logic from OnBarUpdate() instead of fixed text ?
      Close[0].ToString() not displaying correct value and not updating.
      Could you provide some example? thanks.

      Comment


        #4
        Hello Fran09, thanks for your post.

        The best way to render text to the chart is to use sharpDX in the OnRender method. See the "Net Change" indicator as an example of doing this.

        Best regards,
        -ChrisL
        Chris L.NinjaTrader Customer Service

        Comment


          #5
          I am currently using OnRender() method and rendering some of the information I need but I wanted to move this information to the label I've added in the chart trader lower grid area.
          But thank you anyway

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by kevinenergy, 02-17-2023, 12:42 PM
          116 responses
          2,757 views
          1 like
          Last Post kevinenergy  
          Started by franatas, 12-04-2023, 03:43 AM
          7 responses
          106 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by jpapa, Today, 07:22 AM
          0 responses
          2 views
          0 likes
          Last Post jpapa
          by jpapa
           
          Started by Jltarrau, Today, 05:57 AM
          3 responses
          7 views
          0 likes
          Last Post Jltarrau  
          Started by f.saeidi, Today, 05:56 AM
          2 responses
          8 views
          0 likes
          Last Post NinjaTrader_Erick  
          Working...
          X