Re: Price Movement
Brought to you by:
rathmann
|
From: David S. <Dav...@Ma...> - 2009-03-20 14:15:45
|
Hi Uwe, I looked into this a little bit yesterday. The "candlestick" plot is a very common way to display statistical information about measurements. In the language used by statisticians, this is called a "box plot" or "box and whisker plot". Here's the English Wikipedia entry: http://en.wikipedia.org/wiki/Box_plot Each box is a summary of statistical information about the measurements from which it is derived. In Frederic's case, these are the trading statistics for a certain period of time, but it could be any kind of data where multiple measurements make up a single "data point". There are usually 5 and sometimes 7 or more values associated with each "box" and "whisker". The top and bottom of the "whisker" (thin stick) usually represent the maximum and minimum values of the set of measurements (although sometimes they are the 90% and 10% values for the set). The top and bottom of the box usually represent the 75% and 25% limits (in other words, 50% of the measurements lie inside the box). Sometimes a line is drawn across the box at the median (50%) point. In addition, sometimes a second line is drawn representing the mean (average) value. If you do not think in terms of open/close/high/low, but think of -any- 5 values describing a sample, then you have a plot type that has many uses, not just financial. An example from my field, chemistry: http://www.lcgceurope.com/lcgceurope/data/articlestandard/lcgceurope/132005/152912/article.pdf And this has a very tricky example, where the y axis is log, not linear: http://www.physics.csbsju.edu/stats/box2.html So maybe use the statistics terminology and call it a QwtBoxPlotCurve, with QwtBoxPlotItem(s)? For item properties (and you are right, there are a lot of them if you want to be very general): - orientation: horizontal or vertical - draw stick: boolean - draw stick crossbar: boolean - crossbar style: both sides, left / top side, right / bottom side (depends on orientation) - crossbar location: top / right, bottom / left, both (depends on orientation) - crossbar width: int - stick pen - stick minimum: double - stick maximum: double - draw box: boolean - box pen (outline) - box brush (fill) - box width: int - box minimum: double - box maximum: double - box lines (at least one, maybe two or more): each has a pen and value Some box plots allow plotting "outliers" above or below the stick. If you support this, maybe the best thing is to allow for a symbol (marker) and array of marker locations. And then there are text labels, ... Regards, David _______________________________________________________________ David Stranz, Ph.D. dav...@Ma... Sierra Analytics, Inc. 5815 Stoddard Road, Suite 601 Modesto, CA 95356 Tel: (209) 545-8508 http://www.massspec.com _______________________________________________________________ Uwe Rathmann wrote: > Hi Frédéric, > >> I have seen that this was on the todo list and I decided to implement it. > > The idea behind the QwtPlotSeriesItem template is to make the implementation > of new types of plot items more easy - hoping for contributions like yours. > >> I would continue to implement more representations, but I think that >> it would be better to get a feedback and make some documentation >> before. > > The only thing I would change is to introduce a drawSample method, so that the > iteration over the samples + ( maybe the translation into pixel values too ) > can be shifted into a style independend code. > Maybe it makes sense to introduce a symbol class. At the moment you have 2 > brushes and a pen as symbol attributes, but if you complete them with all > possible pixel geometries (width of the sticks, length of the hirizontal > lines ... ) the API of the curve class gets bloated soon. > > Concerning the names: when I wrote "price movement" into my TODO list I > thought about a good name, but didn't find one. But I completely agree with > David, that good names are very important: > > I can't imagine, that a tuple of open/close/high/low makes sense outside of a > financial chart. So for me it's o.k. to use a name that is related to this > domain (what's hard for me as I'm no english native speaker). What about > something like QwtTradingXXX or QwtXXXVolatility ? > > QwtPlotPrice is indeed very bad, because it is not a price. I can imagine > something like QwtPlotTradingCurve ? > > Uwe > > ------------------------------------------------------------------------------ > Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are > powering Web 2.0 with engaging, cross-platform capabilities. Quickly and > easily build your RIAs with Flex Builder, the Eclipse(TM)based development > software that enables intelligent coding and step-through debugging. > Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com > _______________________________________________ > qwt-interest mailing list > qwt...@li... > https://lists.sourceforge.net/lists/listinfo/qwt-interest |