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

some NT7.0 overrides in NT 8.0

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

    some NT7.0 overrides in NT 8.0

    Hi,

    In NT7.0, my indicator used override Plot(..) to change bar color according to ChartControl.ChartStyle.ChartType. But in NT 8.0, either Plot(..) is gone, or ChartControl.ChartStyle.ChartType is no longer available. I tried to find alternative but couldn't success. Could someone tell me how to get a plot override, and get ChartStyle property?

    Thank you!

    #2
    Hello ableyfan,

    Thank you for your post.

    The name is now OnRender(), you can find information at the following link: http://ninjatrader.com/support/helpG...s/onrender.htm

    ChartControl still exists, but has been modified. The documentation for ChartControl is here,
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Hi Jessica,

      Thanks for the help! I was able to locate OnRender, And about ChartStyleType, I see it could be retrieved from chartControl.BarsArray[0].Properties.ChartStyleType. Is this the correct approach? Seems BarsArray is for multiple charts, I used [0] for the single chart situation. Or there is another one for single chart only?

      Thank you!

      Comment


        #4
        I found there is property of ChartBars, I guess that's for single data serial chart.

        Another question, where did BarColor, CandleOutLineColor, BarColorSeries and CandleOutlineColorSeries go?

        Thank you!

        Comment


          #5
          With respect to BarsArray, you are very close; this is actually designed for a single chart already, but for multiple data series. Many data series have plural versions that allow you to pull in data for multi- data series charts. For example, Close and Closes[0] refer to the same data series. This page has more information on the topic.



          The singular form of BarsArray is simply Bars; Bars and BarsArray[0] refer to the same series. You can learn more about Bars here,



          This said, I would recommend as a habit using the BarsArray[0] form that you did use, since Bars <-> BarsArray does not follow the same singular / plural name convention that e.g. Open, High, Low, or Close (which become Opens, Highs, Lows, and Closes, respectively) follow. This is just a policy that has made it easier on me as a programmer to keep everything straight in my head as I write code. If Bars makes more sense to you, you should use that instead.

          With respect to Colors, these have become C# Brushes. This link will have information as far as working with Brushes.

          Jessica P.NinjaTrader Customer Service

          Comment


            #6
            Yeah, I used wrong terms. When I said "multiple charts" it should be "multiple data series". I suppose you mean ChartBars is for single data serial (primary) and BarsArrays for multiples.

            I still couldn't find brushes for bar color. The closest one I can get is ChartBars.Properties.ChartStyle. There are up/down brush for different condition colors. If I change them, will the bar be painted in the color set? Where is candle outline color? How about other chart style (such as OHLC) color brushes?

            Thank you!

            Comment


              #7
              Most of the built-in Colors in NT7 exist as SolidColorBrushes in NT8. For example, Colors.ForestGreen is Brushes.ForestGreen.

              As far as the other members you mentioned

              Jessica P.NinjaTrader Customer Service

              Comment


                #8
                Originally posted by NinjaTrader_JessicaP View Post
                Most of the built-in Colors in NT7 exist as SolidColorBrushes in NT8. For example, Colors.ForestGreen is Brushes.ForestGreen.

                As far as the other members you mentioned

                Great! I found them. Thanks for the help!

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by TradeForge, 04-19-2024, 02:09 AM
                2 responses
                28 views
                0 likes
                Last Post TradeForge  
                Started by aprilfool, 12-03-2022, 03:01 PM
                3 responses
                327 views
                0 likes
                Last Post NinjaTrader_Adrian  
                Started by giulyko00, Today, 12:03 PM
                1 response
                5 views
                0 likes
                Last Post NinjaTrader_BrandonH  
                Started by f.saeidi, Today, 12:14 PM
                1 response
                4 views
                0 likes
                Last Post NinjaTrader_Gaby  
                Started by AnnBarnes, Today, 12:17 PM
                1 response
                2 views
                0 likes
                Last Post NinjaTrader_Zachary  
                Working...
                X