tarkah / tickrs

Realtime ticker data in your terminal 📈
MIT License
1.16k stars 58 forks source link

Is it possible to show the volumes too? #43

Closed acarpe closed 3 years ago

tarkah commented 3 years ago

I have volume data so this should be doable. I'm afraid out of the box, it won't work well to graph volumes along w/ prices since the y-axis range will be completely different. So I have 2 options I think:

  1. Add a keyboard shortcut to "toggle" between prices being graphed and volumes. So only 1 is graphed at a time, so the y-axis can adjust accordlingly.
  2. Normalize volumes against the min / max of the prices so I can graph it alongside the price graph. There won't be any axis labels to reference for volumes however.

The other thing is I'd prefer to do bar graphs for volumes, which the TUI library I'm using supports, but it'd have to be a separate graph from the price movement. I'll play around with all 3 of these ideas and see what works best, might take me a little while to tackle.

acarpe commented 3 years ago

Great! Thank you for the quick response :) If I can express a preference I'd vote for option 3.

tarkah commented 3 years ago

Here are a few rough mockups, I still need to add some logic to make sure the bars extend the entire width perfectly. There's a bunch of caveats, but it's at least a good indicator of volume trends. Since I need to draw distinct bars, the "timeframe" of each bar is dependent on how wide your terminal is.

Do you like it better when the bars are clipped by the price lines? Or where the bars overlap with price lines?

Code_BgA5vAh5UW Code_OMDI66KNlo

Do you want to see an axis legend on the right side, similar to the one for prices on the left? Or is having the days total volume in the header along w/ current / high / low price fine?

tarkah commented 3 years ago

Ok, I think I found the better layout... And I figured out the logic to ensure it'll always fit the width. I'll try to add some y-axis legend just like w/ price and clean up the format a little. How do you like this?

image

image

image

acarpe commented 3 years ago

Looks great! Well done! 🔝

tarkah commented 3 years ago

Ok, I've wrapped this up. I'll merge and release later today once I confirm it all still renders properly after shifting from regular to post market. Here is what it looks like!

Screenshot from 2021-02-04 09:37:19 Screenshot from 2021-02-04 09:37:28 Screenshot from 2021-02-04 09:37:42

tarkah commented 3 years ago

I've added a single line volume indicator for summary view when volumes are toggled on:

Screenshot from 2021-02-04 12:39:37

acarpe commented 3 years ago

It's perfect! 🥇