No announcement yet.

Partner 728x90


Renko Chart Bug

  • Filter
  • Time
  • Show
Clear All
new posts

    Renko Chart Bug


    I explore your RenkoBarType source code and i want to inform you;

    1) There is lines between 93-110 never will be work so these lines are meaningless. If i'm wrong please inform me about in which situations it works.

    2) Renko calculation wrong on situation "bars.IsResetOnNewTradingDay && isNewSession" condition is true;
    2.1) Suppose symbol is ES and brick size is 4 so every brick value is $1. Suppose todays first renko low is 2180.00 and of course high will be 2181.00 for green renko, i mean by chance drawing with whole numbers (XXXX.00) very next day renko starts drawing based on .25s, .50s or .75s. This is happening sometimes but this behavior is wrong.
    2.2) When new session starts there is a tick on renko chart between current and previous session's renko bars. I don't understand what it's purpose but can not be draw on chart.

    If you need, i can send you screenshots. If you are not accepting these are bug. Please tell me how can i change current behavior like i said. But i want to say that also, if you change your renko like i said, ninjatrader will be one of 2-3 platforms drawing the renko correctly. Also i have to say that your renko bar type parameters not enough. Your renko working only fixed close but there is high/low renko, percentage renko, break even renko etc. Yes i know you'll said look at third parties but you have to support these type charts default, because they are popular and will be more popular at the near future.


    Hello aytacasan, and thank you for your report.

    Could you come up with a reproducible test scenario, including renko brick size, and either

    • usage of the Playback Connection
    • an instrument, expiry, and date range
    • dates and times where Renko bars are plotting inappropriately


    • usage of the Simulated Data feed
    • instructions regarding manipulation of the playback slider which will result in an incorrect renko bar

    With regard to lines 93-110, while this would not come up during trade simulation, it is likely especially with a program that exposes a tool like the simulated data feed - which forces us to consider every possible arbitrary closing price value - that one of close + offset or close - offset, as seen in lines 74-75, or many similar occasions where renkoHigh and renkoLow appear on the left side of an equals sign, could be zero.

    The pictures you offered would be appreciated. Thank you for helping to improve NinjaTrader 8.
    Jessica P.NinjaTrader Customer Service


      Hi Jessica,

      Thanks for your response. I attach a screenshot and try to explain every thing on it. If you need any plus explanations, please inform me. I want to clarify;

      1. Renko charts can not contain any bar or any tick that different size of it's brick size parameter. Because of that at the beginning of sessions tick is a bug.
      2. Renko charts can not show price gaps, gaps must be fill bricks. Because of that price gaps is bug which is especially happening at the beginning of sessions.
      3. Renko chart especially fixed close renko charts (Ninja only drawing this type for now) if you see consecutive green bars then if price will fall start point again, that red bar's close values must be exactly equal same level green bar's open values. Because of that all sessions(all bars on the chart) must be draw .00 or .25 or .75 base. If you need more explanation about that please inform me.
      4. About code between 93-110 lines, sorry but don't understand what you mean please send me settings that will work this lines;
      Which instrument?
      Which contract?
      Which connection type?
      Which time frame?
      Which brick size?
      I need to understand why this lines is necessary.

      Best Regards,
      Attached Files


        Thank you aytacasan. I have enough information to proceed on my end.

        If you would like to try your hand at creating a test scenario where those lines of code we mentioned execute, you can try the following :

        • Tools -> Export -> Historical Data
        • Select an instrument, market data type, etc to export and press Export
        • Browse to a known file location and save there
        • Edit the exported file by hand in your favorite editor, changing every price to 1.00

        You should then be able to get those lines of code to execute with 4-brick Renko bars, in the playback connection, playing over historical data. This is thanks to line 75.
        Last edited by NinjaTrader_JessicaP; 11-18-2016, 11:00 AM.
        Jessica P.NinjaTrader Customer Service


          After reviewing the code and pictures you sent, I will need to point out another scenario I will not be testing for. I will be using Investopedia's publicly available definition for Renko bars.

          Originally posted by
          What is a Renko chart?

          A Renko chart is a type of chart, developed by the Japanese, that is only concerned with price movement; time and volume are not included. It is thought to be named for the Japanese word for bricks, "renga". A renko chart is constructed by placing a brick in the next column once the price surpasses the top or bottom of the previous brick by a predefined amount. White bricks are used when the direction of the trend is up, while black bricks are used when the trend is down. This type of chart is very effective for traders to identify key support/resistance levels. Transaction signals are generated when the direction of the trend changes and the bricks alternate colors.
          From this definition, some points that are relevant need to be made.

          • Nowhere in the Renko definition does it specify that the first bar must start on an even dollar (or other base currency) boundary. That means that the numbers after the decimal for all Renko bars in a series may be any of .00, .25, .50, or .75, for the chart you sent, provided all the following bars in the series adopt the same values
          • There is also no guarantee in this definition that bars will start on the same price between sessions

          This said, I understand that it is desirable that the flat bricks between sessions be eliminated, and that a Renko bar that bases its initial offset on the first available bar, rather than the first bar of each session, is desirable to customers, and so I have made the following feature request.

          This customer would like a Renko bar that ignores session boundaries

          I will follow up with more information as soon as it's available. If the feature requests already exists, a vote will be added to it.

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


            Weren't those between session bars (renko and range) eliminated so that trading strategies would not try to trade on non real bars in replay or the analyzer?
            NinjaTrader Ecosystem Vendor - Integrity Traders


              I have feedback from the development team.

              If you press ctrl + f to bring up your data series window, uncheck "Break at EOD", and press "OK", your Renko bars will work as expected, both eliminating the small bars between days, and ensuring that your first bar's offset is preserved across all session breaks.

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


                Hi Jessica,

                1. I don't understand your last post about 93-110 lines. What is your point? I try your steps but can not follow.

                First when i export historical data there is no header line(try to export tick data). But i think first price is bid, second is ask and last one is last price column, am i right?

                Second, there is no way to set all price 1 manually, there is dozens of lines even for one day data.

                From your preview posts i understand that this lines only working when you use simulated data feed, is it right?

                Also i'm requesting which condition to set renkoHigh and/or renkoLow to zero, especially renkoHigh. For example "continuously falling market condition renkoLow will be zero if previous brick low is 1". After that i can understand what is the logic of these lines.

                2. My opinion investopedia can not be reference at that detail. It's containing smattering of financial. But this is not important i'll try to develop custom bar type, thanks ninjatrader for support that

                3. Uncheck "Break at EOD" is solved my problem, thanks for your help about that.

                Best Regards,


                  I am glad we were able to resolve your second and third query. To your first query, my intent was only to force a situation where the offset price is equal in magnitude to 1/4 the trading price. Any time this situation occurs, these lines would be activated. While this situation is not realistic in real trading, it is realistic when programmers are developing NinjaScript code, and without these lines we would cause difficult to debug headaches for coders in the corner case these lines otherwise resolve.
                  Jessica P.NinjaTrader Customer Service


                    I think i understand what are you mean. I need work on it later. Thanks for your help.


                    Latest Posts


                    Topics Statistics Last Post
                    Started by JarodB, Today, 04:44 AM
                    0 responses
                    Last Post JarodB
                    by JarodB
                    Started by leonardo3381, Today, 01:58 AM
                    3 responses
                    Last Post NinjaTrader_Marco  
                    Started by Mindset, Today, 02:16 AM
                    0 responses
                    Last Post Mindset
                    by Mindset
                    Started by dvcpro4, Yesterday, 07:20 PM
                    1 response
                    Last Post NinjaTrader_ChrisSch  
                    Started by Aramunno, Yesterday, 04:25 PM
                    1 response
                    Last Post NinjaTrader_Marco