[email protected]
Posts: 3
Joined: Sun Jan 27, 2019 1:25 am

Renko chart : completely working solution

I have searched this forum and Google, on creating renko charts using highstocks. There are some links and demoes posted as responses, but none of the solutions even come closer to a workable renko chart.

One of the quite close to renko chart solution doesn't correctly display price and date. For smaller change or box size, it results in completely useless chart.

The problem is that when box size is smaller than actual price change, there should be multiple renko boxes for the same x-axis date values. But none of the solutions address that.

So, is it even possible to create an accurate Renko Chart for any box size using Highstocks API? If so, could you please post a working demo or code snippet? Thanks.
bastss
Site Admin
Posts: 1192
Joined: Wed Oct 17, 2018 10:59 am

Re: Renko chart : completely working solution

Hello [email protected],

Welcome to Highcharts forum and thank you for contacting us!

For now, unfortunately, Highstock doesn't offer official Renko chart. But, have you checked these two examples of Renko chart created by our team?

http://jsfiddle.net/p6g3hw66/
https://jsfiddle.net/BlackLabel/r4evsx06/

What do you think about them? Please describe more details what you expect from Renko chart, we will try to reproduce it.

Best regards!
Sebastian Wędzel,
Highcharts Developer
[email protected]
Posts: 3
Joined: Sun Jan 27, 2019 1:25 am

Re: Renko chart : completely working solution

Hi,
Thanks for your response. I had already come across those links. The main problem with both of them is that if you set PIP or CHANGEAMOUNT to smaller values such as "0.10" or "0.50", the chart no longer displays valid prices for corresponding dates. The way Renko chart is supposed to work is that if the actual change in price is larger than the set PIP or CHANGEAMOUNT, then, new brick should be drawn by repeating the same date tick mark.

If you set change amount to 0.10, on the first link above, it simply goes to next day after every 0.10 change, so, that's completely inaccurate.

The 2nd chart doesn't even draw renko boxes for smaller pips.
bastss
Site Admin
Posts: 1192
Joined: Wed Oct 17, 2018 10:59 am

Re: Renko chart : completely working solution

[email protected],

We made some modification in the above example and now if the change in price is founded chart doesn't render one box, but an amount equal to quotients of set steps(1, 0.5 etc) to price change. In tooltip, you can notice that time difference between steps for one day is equal 1 millisecond, we need to set that, otherwise, Highstock renders bricks on one data - that will destroy whole logic. Of course, it is possible to format displays date on the tooltip.

Demo: https://jsfiddle.net/BlackLabel/d361ynwg/

Let us know what you think about this one Renko example.

Best regards!
Sebastian Wędzel,
Highcharts Developer
[email protected]
Posts: 3
Joined: Sun Jan 27, 2019 1:25 am

Re: Renko chart : completely working solution

Thanks again for the quick response. I had also come up with similar approach of adding 1 to the datetime timestamp to add new bricks. While not robust this does establish the base for further improvement.
azadcoder
Posts: 12
Joined: Tue Apr 13, 2021 1:05 pm

Re: Renko chart : completely working solution

I made a renko chart with the jsfiddle example but my data is different.
somthing like this

Code: Select all

[
                {
                    "datetime": "2021-04-12 15:59:00",
                    "open": "131.31261",
                    "high": "131.39999",
                    "low": "131.24001",
                    "close": "131.26990",
                    "volume": "939809"
                },
                {
                    "datetime": "2021-04-12 15:58:00",
                    "open": "131.30130",
                    "high": "131.34000",
                    "low": "131.22000",
                    "close": "131.28810",
                    "volume": "531445"
                },
 ]
How can I use this data in the Renko chart.
dominik.c
Posts: 2081
Joined: Fri Aug 07, 2020 7:07 am

Re: Renko chart : completely working solution

Hello azadcoder!

Welcome to our forum and thanks for contacting us with your question!

As you can see Highstock doesn't offer an official Renko chart, and we've got a custom implemented one, so you need to adjust your data to the code. This means that your data should be in the format: x, y, low, high.

Best regards!
Dominik Chudy
Highcharts Developer
onejbsmith
Posts: 1
Joined: Wed Jun 02, 2021 11:44 am

Re: Renko chart : completely working solution

HighCharts Team,

Please see jsFiddle below for a better Renko solution.

Your solution depends on having price changes between contiguous points that exceed the bar size.

This solution tracks price changes from the previous bar, instead.

[url][https://jsfiddle.net/onejbsmith/hs7o8ewp/]


Ciao,
Joe
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Renko chart : completely working solution

Hi Joe,
Welcome to our forum and thanks for your message!

I appreciate you sharing your solution with us.

Best regards.
Sebastian Hajdus
Highcharts Developer

Return to “Highcharts Stock”