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 Tim-c, Today, 03:54 AM
      0 responses
      3 views
      0 likes
      Last Post Tim-c
      by Tim-c
       
      Started by FrancisMorro, Today, 03:24 AM
      0 responses
      2 views
      0 likes
      Last Post FrancisMorro  
      Started by Segwin, 05-07-2018, 02:15 PM
      10 responses
      1,770 views
      0 likes
      Last Post Leafcutter  
      Started by Rapine Heihei, 04-23-2024, 07:51 PM
      2 responses
      31 views
      0 likes
      Last Post Max238
      by Max238
       
      Started by Shansen, 08-30-2019, 10:18 PM
      24 responses
      945 views
      0 likes
      Last Post spwizard  
      Working...
      X