question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should remove breaks for OHLC, Candlestick

See original GitHub issue

The code to reproduce is based on simple-candlestick-chart-example . The difference is:

11th, 12th are not existed in the dataset (simply because they’re weekdays/non-trading days), but candlesticks in the chart should be continued, i.e.: the breaks of 11th, 12th should be removed like what highcharts do.

This behaviour should be the default one for OHLC and Candlestick charts, otherwise it will become terrible for real world dataset.


https://codepen.io/mckelvin/pen/ygwMQz is my workaround by using tickvals and ticktext. But there’s another problem: nticks doesn’t work when tickmode=array as mentioned in docs, there will be too many tick labels if there’re too many ticks.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:7
  • Comments:31 (10 by maintainers)

github_iconTop GitHub Comments

8reactions
santosjorgecommented, Mar 30, 2017

In my opinion - I think it is an overkill to expect Plotly having to retrieve holidays/trading sessions for all instruments. You will also have to handle scenarios where there is multiple calendars (ie a GBP swap).

Most data providers already take into account non-trading days/market sessions into account. That means the data has already been cleaned/adjusted.

The only thing required would be a layout parameter to create an axis that will omit the dates for which no values exist in the timeseries.

6reactions
etpinardcommented, Mar 12, 2020

In v1.53.0, users will be able to remove non-working days and non-working hours using the new axis.breaks API for type: 'date' cartesian axes.

Some examples:


I’ll leave this issue open as some folks here appear to prefer the “date as categories” approach - which is another planned feature of ours.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Candlestick plot: how to remove non-trading periods? - hvPlot
Hi,. It's really great that hvplot has a candlestick chart (called ohlc ). But is there a way to get rid of the...
Read more >
Remove gaps from time-series/OHLC plot - Plotly Python
Should remove breaks for OHLC, Candlestick. The code to reproduce is based on simple-candlestick-chart-example . The difference is: 11th, 12th ...
Read more >
Matplotlib remove space of candlestick for missing data
So after I plotted it, it has spaces between the candlesticks. result image. How can I remove these? Here is my plotter function...
Read more >
Hide space between Candlestick/OHLC chart - CanvasJS.com
You can use axis scale-breaks to remove the empty space. Also you can set spacing to 0, so that it looks continuous. —...
Read more >
Python Trading Toolbox: introducing OHLC charts with ...
Removing them requires some extra non-trivial filtering. Similarly, a candlestick chart can be generated in the following way: Which produces: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found