cli-candlestick-chart icon indicating copy to clipboard operation
cli-candlestick-chart copied to clipboard

Feature Request: Add additional lines for custom indicators

Open NLKNguyen opened this issue 2 years ago • 2 comments

Hi,

Thanks for the amazing work. Is there any plan to support additional lines to the chart for custom indicators? That would open doors to various kinds of technical analysis visualization.

For example, horizon/vertical lines, or arbitrary time-series data such as Moving Average. I imagine the data can be embedded in the JSON data stream along with the current OHLC fields.

NLKNguyen avatar Nov 25 '21 02:11 NLKNguyen

Hey, thanks you !

I am afraid that this is not possible. Since the graphic is drawn using unicode characters, it is not possible to draw other characters on top of the candles. The only solution I see would be to display the technical indicators below the chart a bit like for the volumes but I think that would lose a lot of its interest for some indicators, especially for moving average.

Maybe we could try to draw this behind the candles but I'm really not sure of the result. I'll do a test in the next days/weeks If you have a better suggestion let me know !

Julien-R44 avatar Nov 25 '21 02:11 Julien-R44

Did you have a chance to try drawing behind the candles? I think that is a good compromise to have the candles always on top. I see that Unicode braille characters are commonly used to represent line plots. Some references I found:

  • https://github.com/dcat/tplot
    • https://lyngvaer.no/log/graph-plotting-terminal-braille
  • https://github.com/asciimoo/drawille
    • https://github.com/madbence/node-drawille
  • https://github.com/red-data-tools/unicode_plot.rb
  • https://github.com/atsaki/termeter
  • https://github.com/red-data-tools/YouPlot
  • https://github.com/tammoippen/plotille
    • https://pythonawesome.com/plot-in-the-terminal-using-braille-dots-with-python/
  • https://github.com/cjbassi/ytop/issues/79#issuecomment-675707196

NLKNguyen avatar Dec 11 '21 04:12 NLKNguyen