Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting Chart control background color in NT8

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

    Getting Chart control background color in NT8

    Hello, I'm trying to detect chart background color in my indicator, but NT7 method does not work in NT8 and I was not able to find it in the forum. Would you please give me a hint, how to read the color (or the brush)? I do not need to change it, I just need to read the value. Thank you.
    Attached Files

    #2
    Hello mantak007, and thank you for your question.

    This slightly modified excerpt from the help guide demonstrates how to access the chart's background.
    http://ninjatrader.com/support/helpG...properties.htm

    Code:
    [FONT=Courier New]protected override void OnRender(ChartControl chartControl, ChartScale chartScale)
    {
      // Instantiate a ChartControlProperties object to hold a reference to chartControl.Properties
      ChartControlProperties myProperties = chartControl.Properties;
     
      // Show the chart background color
      Print("The chart background brush is " + myProperties.ChartBackground);
    }[/FONT]
    Bear in mind ChartControlProperties.ChartBackground is a Brush object. You can find publicly available MSDN documentation on Brush objects here, https://msdn.microsoft.com/en-us/lib...ing.brush.aspx .

    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Great, that's what I was looking for, thanks.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by sjsj2732, Yesterday, 04:31 AM
      0 responses
      22 views
      0 likes
      Last Post sjsj2732  
      Started by NullPointStrategies, 03-13-2026, 05:17 AM
      0 responses
      280 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      279 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      130 views
      1 like
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      90 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Working...
      X