Author Topic: Modified Renko Chart: problems on charts and backtests  (Read 60 times)


  • Newbie
  • *
  • Posts: 1
    • View Profile
Modified Renko Chart: problems on charts and backtests
« on: October 03, 2017, 09:13:25 am »
I’m planing on developing a strategy based on Renko, however I can’t make it work correctly on Amibroker (more on that later). To start things over I tried to use the recommended code for Renko as shown here ( - replacing ‘reverse’ for something else like ‘reverseval’ otherwise it wouldn’t run). I’m also using tick by tick data for history and to make things accurate. For the backtests I also chose the “periodicity” as tick. Unfortunately I'm still on square zero as the sample code isn't running smoothly.
For a start, prices are plotted correctly with the only exception that the X-axis is not showing the days nor the times correctly. It’s actually WAY OFF the correct timestamp. The only way I could figure it out is by using other software (from which I extracted the database) to compare. I have to say that time-based charts plot correctly, as this lack of synchronicity only happens under Renko. Of course, I know that the X-axis couldn’t be kept linearly proportional: in fact, I would expect it to compress and expand as the market speed increases or decreases (new price levels can come quickly or slowly and that will reflect on the quantity of bars plotted and on the X-axis itself). Other software does this compression and expansion so that timestamps are correctly plotted on the X-axis. Any way I could make Amibroker do that as well?
As a consequence of the above, depending on the brick size I choose data plotted under Renko never encompasses the whole database, as the chart ends some hours or days before the end of the database. The largest the database the largest the missing part at the end of the chart.

When I try to run a backtest, no matter what is the date range of the database, the positions opened cover only around the last 10% of the range chosen. For example, if I load just a few days, it only opens positions on the last part of the last day. What can I do to fix the problem so that it opens positions from the beginning of the first day of the database?
Barcount is also not behaving correctly, as far as my understanding goes:
1) I recorded the Barcount for each time range I tested. It steadily increases until 2 months’ worth of past data and then it toped at 10000000. After that it did chang a bit but never reached 20000000. I concluded that with more than 2 months of data the results are not reliable anymore. Is that limitation of 2 months of Tick data related to the maximum value that Barcount can reach (which I suppose is something around 10000000)?
2) In a regular time-based chart, Barcount takes into account only the visible bars at the screen. On the Renko chart, however, it seems that Barcount always takes into account the number of bars of the whole database, no matter what’s shown on the chart. Could anyone please help me understand why this is happening?
Honestly I’m having a ton of problems with Amibroker and Renko, please point me to the right direction!
Thank you.