Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"line" styles for financial market charting #4

Closed
JeffreySarnoff opened this issue Sep 10, 2015 · 11 comments
Closed

"line" styles for financial market charting #4

JeffreySarnoff opened this issue Sep 10, 2015 · 11 comments

Comments

@JeffreySarnoff
Copy link

named styles (OHLC, HLC ...)
and (not just for finance)subparts that could be combined into customized styles

lineparts

@tbreloff
Copy link
Member

Seems like this might make sense to be another linetype, which defaults to :step or something similar when not implemented. If you can create the chart you'd like using the linetypes that exist already, it should be pretty easy to add.

@lobingera
Copy link

@JeffreySarnoff
Can you please give more examples? Is this line styles, so styling the line that is drawn, or is this about markers that show additional information at certain samples?

On my own plotting agenda i had for some times some ideas (pending) to deal in plots or a plotting engine even with markers that are not predefined, but somehow read-in or imported. Think about using a marker defined by some draw imported from a .svg file. Plotting then could be a 2D plot with x-y lines on one value of a timeline and a second value selecting a marker out of a set of markers.

@tbreloff
Copy link
Member

Part of this request is to allow for many marker styles, which would be great, but I suspect may be hard to accomplish depending on the plotting backend. I agree it would be great to have a library of markers to choose from, and if the svg is stored within Plots.jl, it may be possible to pass in custom markers to some of the backends. Right now I'm only using markers built into the backends.

@JeffreySarnoff
Copy link
Author

@lobingera
This gets difficult, I imagine, as I have not seen it done very accessibly elsewhere. Ultimately, my preoccupation with regard to plots is presenting additionally informative elements without sacrificing visual clarity. When working with stock prices or fuzzy numbers there are sub-aspects that are significant without being sufficient to well-represent the information at a 'point'.

For a daily plot of a stock, people use vertical stick for the high-low range with two thin horizontal tabs for the open (leftward) and close (rightward) prices. Volume is often shown as a second plot below the price plot. To incorporate volume into the primary plot, I might map volume into a blue--red (less(cold)--more(hot)) colorspace and colorcode each vertical stick accordingly. If I had more information, the vertical sticks might become ovoids or thin superellipses.

To do this requires smart, composable and context-aware markers. To do similar with fuzzy information requires the same of curvilinear plot subdivisions.
These thoughts are offered as perspective, just so nothing done interferes with building up to such capability.

@lobingera
Copy link

@JeffreySarnoff
This might look difficult, but if we lay the foundations of markers that are called/rendered with input parameters, your example falls into the easier category because the marker is plotted independently of the surrounding graph, it's just more info at the same x-position. I can follow your text, but can you please somehow attach a picture here?

@tbreloff
Copy link
Member

So on some level this is pretty easy to do with certain backends (gadfly/immerse comes to mind). Similar to how it's done with boxplots, the y input could be a tuple of (open,high,low,close) (either vector of tuples, or tuple of vectors), and I'd create a custom compose context on the fly for each x. I borrowed some code from @dcjones to start supporting some other marker shapes, and I could do nearly the same thing for alternate custom plots like OHLC.

What would be most helpful is a detailed description of what your ideal visual looks like, so pictures/drawings are helpful.

@JeffreySarnoff
Copy link
Author

ok .. I can paint something tomorrow.

@tbreloff
Copy link
Member

I started playing around with passing in vectors of tuples, and then fiddled with making a new polygon, and then... I was done?

julia> using Plots

julia> n=10; hgt=rand(n)+1; bot=randn(n); openpct=rand(n); closepct=rand(n);

julia> y = [(openpct[i]*hgt[i]+bot[i], bot[i]+hgt[i], bot[i], closepct[i]*hgt[i]+bot[i]) for i in 1:n];

julia> plot(y, linetype=:ohlc, markersize=10)

tmp

@tbreloff
Copy link
Member

I'm going to close this, but please don't let that stop you from adding a drawing of an alternative shape.

@JeffreySarnoff
Copy link
Author

@tbreloff
Copy link
Member

This is quite different from the OHLC charting. I think, to make this graph, you would want to attach a color scheme based on a z-coordinate. Gadfly has this ability, and I certainly intend to support it. I'd say give me a few days and you should be able to do this very simply.

@tbreloff tbreloff mentioned this issue Sep 18, 2015
jheinen added a commit that referenced this issue Jan 27, 2020
…4-11-03-47-200-2951760626

CompatHelper: bump compat for "GR" to "0.45"
yha added a commit that referenced this issue Aug 26, 2020
t-bltg pushed a commit that referenced this issue Oct 6, 2022
readme: various minor fixes & tweaks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants