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

Help with buttons

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

    Help with buttons

    Hello. Can somebody help me?

    I'm trying to configure a button for the NT8 chart. I want this to display the Buy Pressure values, for example. I have this code, how do I correctly give it the real-time data argument?

    As you can see in the image the button shows zero value.

    Is it possible to do this with a button? What code could I use to make it functional?​

    Thanks.

    Attached Files

    #2
    Hello emsolis88,

    You would need to add some additional code to where you get realtime data to set the buttons text. That could be from OnBarUpdate or OnMarketData. The code you have shown is just where you create the button, that only happens once so that won't continuously update the buttons text. That's just used to set the default value.

    From the image you would use the myButton1 variable to access that button control. When working with UI elements you need to surround that code with a dispatcher so where you use myButton1 needs to also be surrounded by the dispatcher code shown in the image. You can set the buttons content by using its Content property:

    Code:
    ChartControl.Dispatcher.InvokeAsync(() => {
        myButton1.Content = "sometext";
    });
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thank you so much. I already have it working. I hadn't thought of this.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by frankthearm, Yesterday, 09:08 AM
      14 responses
      47 views
      0 likes
      Last Post NinjaTrader_Clayton  
      Started by gentlebenthebear, Today, 01:30 AM
      2 responses
      13 views
      0 likes
      Last Post gentlebenthebear  
      Started by Kaledus, Today, 01:29 PM
      2 responses
      8 views
      0 likes
      Last Post Kaledus
      by Kaledus
       
      Started by PaulMohn, Today, 12:36 PM
      2 responses
      16 views
      0 likes
      Last Post PaulMohn  
      Started by Conceptzx, 10-11-2022, 06:38 AM
      2 responses
      56 views
      0 likes
      Last Post PhillT
      by PhillT
       
      Working...
      X