Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do I draw Button on Chart Trader instead of Chart?

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

    How do I draw Button on Chart Trader instead of Chart?

    I have the basic code to draw buttons on the chart below. Adding more rows and columns is pretty easy.

    How do I draw the same buttons on the Chart Trader panel?

    I assume/hope there is a simple addition that moves it from the chart to the chart trader, but I haven't been able to find it

    thanks


    PHP Code:
    
            private System.Windows.Controls.Grid myGrid;
    ​
    
    
    
    Dispatcher.InvokeAsync((() =>
                    {
                        myGrid = new System.Windows.Controls.Grid
                        {
                            Name = "MyCustomGrid", HorizontalAlignment = HorizontalAlignment.Right, VerticalAlignment = VerticalAlignment.Top
                        };
    
                        System.Windows.Controls.ColumnDefinition column1 = new System.Windows.Controls.ColumnDefinition();
                        System.Windows.Controls.ColumnDefinition column2 = new System.Windows.Controls.ColumnDefinition();
    
                        myGrid.ColumnDefinitions.Add(column1);
                        myGrid.ColumnDefinitions.Add(column2);
    
                        longButton = new System.Windows.Controls.Button
                        {
                            Name = "LongButton", Content = "LONG", Foreground = Brushes.White, Background = Brushes.Green
                        };
    
                        shortButton = new System.Windows.Controls.Button
                        {
                            Name = "ShortButton", Content = "SHORT", Foreground = Brushes.Black, Background = Brushes.Red
                        };
    
                        longButton.Click += OnButtonClick;
                        shortButton.Click += OnButtonClick;
    
                        System.Windows.Controls.Grid.SetColumn(longButton, 0);
                        System.Windows.Controls.Grid.SetColumn(shortButton, 1);
    
                        myGrid.Children.Add(longButton);
                        myGrid.Children.Add(shortButton);
    
                        UserControlCollection.Add(myGrid);
                    }));​ 
    

    #2
    Hello cre8able,

    Thanks for your post.

    Creating custom Chart Trader buttons could be done using WPF modifications in a NinjaScript.

    Below is a reference sample called SampleWPFModifications that you could view which demonstrates creating custom Chart Trader buttons.

    SampleWPFModifications: https://ninjatrader.com/support/help...ui)-modifi.htm
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    55 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    132 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X