I’ve got OHLC data for the S&P 500 that I would like to plot as a so-called Renko plot ( https://en.wikipedia.org/wiki/Renko_chart ) in gnuplot. I have transformed the OHLC data to fixed-size bricks represented in data.dat
as the upper and lower diagonal corners of rectangles:
# x1, y1, x2, y2
0 6 1 4
1 8 2 6
2 10 3 8
3 12 4 10
4 14 5 12
5 12 6 10
And then so far I can actually get them onto a plot using the following script:
set terminal pngcairo size 800,600
set output 'renko_chart.png'
set grid
set style fill solid
plot 'data.dat' using 1:2:1:3:2:4 with boxxy
Which produces the following:
What I would like to do is colour “up bricks” green, and “down bricks” red. Furthermore, I would like to include a date along the X-axis, without affecting the horizontal scale of the bricks. To get a clearer idea of what I mean, here is an image from the wikipedia article:
Note the date along the bottom, and how the axis scale varies across the width of the image. Towards the left, we see a period of about 6 days take the same amount of space on the chart as a period of just a few hours to the right. The idea is that the price action is decoupled from the time frame, and it is the axis that scales reactively to the data.
Is this possible in gnuplot?