Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to set ChartControl colors including grid lines

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

    How to set ChartControl colors including grid lines

    In NinjaTrader 7 I used the following (hidden) params for ChartControl:

    Code:
    ChartControl.HorizontalGridLinesPen.Color = Color.Transparent;
    ChartControl.VerticalGridLinesPen.Color = Color.Transparent;
    ChartControl.BackColor = System.Drawing.ColorTranslator.FromHtml("#000000");
    ChartControl.SellColor = Color.Orange;
    Are there equivalent params in NinjaTrader 8?

    #2
    Hello,

    Thank you for the post.

    The ChartControl is now documented and the Properties are also exposed for use. You can find these items in the following page:

    https://ninjatrader.com/support/help...b=chartcontrol

    For the properties you are using, it looks like the following items would take their places:

    GridLineHPen
    GridLineVPen
    ChartBackground


    For the ChartTrader, this is not currently exposed for a Property object, but you may be able to access this using a similar approach to the following post: https://ww.ninjatrader.com/support/f...44&postcount=7


    I look forward to being of further assistance.,
    JesseNinjaTrader Customer Service

    Comment


      #3
      Thanks for the quick response. How about ChartControl.SellColor? I don't see that one anywhere in the docs. Also is there a property for SessionBreak lines?
      Last edited by molecool; 10-05-2017, 02:26 PM.

      Comment


        #4
        Hello,

        The SellColor is the later part of my prior reply, you may be able to change the color using the user interface per the post I had linked but there are currently no examples of this. Right now there is no exposed properties object for the chart trader specifically so items in the chart trader would need to be accessed like in the provided post. This is likely an item you would need to use manual programming to both locate the control and change its color.

        For the session break line, please see the ChartBars.Properties object. This is part of the greater Chart documentation, I would suggest reviewing this whole section to see items you may have previously used in NT7's ChartControl.

        https://ninjatrader.com/support/help...n-us/chart.htm


        https://ninjatrader.com/support/help...ession%2Bbreak

        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Originally posted by NinjaTrader_Jesse View Post
          The SellColor is the later part of my prior reply, you may be able to change the color using the user interface per the post I had linked but there are currently no examples of this. Right now there is no exposed properties object for the chart trader specifically so items in the chart trader would need to be accessed like in the provided post. This is likely an item you would need to use manual programming to both locate the control and change its color.
          Well, that's what I am trying to do. I am attempting to programmatically locate the control and change its color. The links you sent me don't seem to have anything to do with that.

          Comment


            #6
            Hello,

            Thank you for the reply.

            The second link in post 2 is related to your question. I noted that you would have to access the chart trader control by its instance because there is no exposed properties object for it. I have added a feature request to have this exposed. The linked forum post shows how to do this, the following syntax would get the chart trader control:

            Code:
            chartTrader = Window.GetWindow(ChartControl.Parent).FindFirst("ChartWindowChartTraderControl") as ChartTrader;
            There is more information in the linked post on how to use this type of syntax and also how to find other controls.

            You would need to explore the ChartTrader control to change items using the techniques listed in the other post. NT8 uses WPF, so you can use standard WPF syntax to change colors of controls or do other actions programmatically. There is not currently a sample of getting specifically the sell button, so this is an item you could use the information on that page to locate if you would like to.

            Please let me know if I may be of further assistance.
            JesseNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ntbone, Yesterday, 11:42 PM
            1 response
            13 views
            0 likes
            Last Post NinjaTrader_PaulH  
            Started by mr_trade, 11-26-2020, 05:01 PM
            5 responses
            59 views
            0 likes
            Last Post mr_trade  
            Started by evanp90, 01-14-2021, 07:03 PM
            4 responses
            33 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by fernlicht, Today, 04:01 AM
            1 response
            8 views
            0 likes
            Last Post NinjaTrader_Jason  
            Started by Leeroy_Jenkins, Today, 03:51 AM
            1 response
            12 views
            0 likes
            Last Post Leeroy_Jenkins  
            Working...
            X