Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Get x,y position of current window

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

    Get x,y position of current window

    Hi,
    Is there a way to get the x, y (in windows terms, the top, left) position of the chart window in which I have added an indicator, within the indicator code?
    Thank-you,
    iq

    #2
    Hello iq200,

    Are you referring to the actual window position or are you referring to the X/Y inside of the chart panel that your indicator can render to?

    You can get either however those are different concepts.

    The ChartPanel object exposes the charts sizes: https://ninjatrader.com/support/help...chartpanel.htm
    You can see the SampleCustomRender indicator for examples of rendering to the corners of the chart.

    If you otherwise meant the window you can access its WPF window properties like the following:

    Code:
    ChartControl.Dispatcher.InvokeAsync((Action)(() =>
    {
    
                    //Obtain the Chart on which the indicator is configured
                    chartWindow = Window.GetWindow(this.ChartControl.Parent) as Chart;
                    chartWindow.Top
                    chartWindow.Left
    });
    I look forward to being of further assistance.

    Comment


      #3
      HI Jesse,
      I was referring to the actual window (which contains the chart) position on the screen.
      The reason I'm asking is that I'm creating an external window and I need to arrange this window alongside the chart window.
      Right now, the external window gets created based on a location determined by Windows.
      It looks like the snippet you posted should do the job.
      Thank-you for your help.
      Regards,
      iq

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      574 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      333 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      101 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      553 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      551 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X