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

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:



    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, 03: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.






        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 alifarahani, Today, 09:40 AM
            6 responses
            29 views
            0 likes
            Last Post alifarahani  
            Started by Waxavi, Today, 02:10 AM
            1 response
            17 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by Kaledus, Today, 01:29 PM
            5 responses
            13 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by Waxavi, Today, 02:00 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_LuisH  
            Started by gentlebenthebear, Today, 01:30 AM
            3 responses
            17 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Working...
            X