Candlestick Issues

John, Thank you for your reply. A couple of issues though.

    > I looked at the documentation and saw the alpha
    > transperancy parameter, but for some reason I was still
    > getting the same results. Maybe I am missing something
    > very fundamental. If alpha is not provided then the
    > default is for the candlestick box not to be transperant,
    > correct? Even changing the alpha value wouldn't produced
    > desired results, I can increase transperancy, but not
    > eliminate it. I wasn't seeing that since I can still see
    > the lines (wicks) go through the boxes that's why I asked
    > here. Also, this may be another foolish oversight on my

OK, I see what is going on. The lines are being plotted over the
rectangles, so even if the rectangles are transparent, you still see
the lines. There are two candlestick functions in matplotlib
candlestick and candlestick2. They have slightly different call
signatures and a different implementation under the hood. candlestick
creates a bunch of separate lines and rectangles, candlestick2 uses
collections (see the help for the matplotlib.collections module).

You can control the z-ordering on the plot by setting the zorder
property (see examples/zorder_demo.py). For candlestick (see
examples/candlestick_demo.py) you would do

  lines, patches = candlestick(ax, quotes, width=0.6)
  set(lines, zorder=0.9*patches[0].zorder)

for candlestick2 you would do (untested)
  
linecol, rectcol = candlestick2(blah)
z = rectcol.get_zorder()
linecol.set_zorder(0.9*z)

    > part, but how come when I have candlestick2(axMiddle,
    > opens, closes, highs, lows, width=4, colorup='k',
    > colordown='r') instead of getting a bar colored black when
    > it closes above the open price I get the opposite --- red?
    > It seems colorup should be black, colordown -- red as in
    > colorup : the color of the lines where close >= open
    > colordown : the color of the lines where close < open

Argg, that's embarrassing. Good thing mpl is distributed with no
warranties.... No telling how many billions this bug has cost the
wall street barons already!

In matplotlib/finance.py in the candlestick2 function, find this code

    colord = { True : colorup,
               False : colordown,
               }
    colors = [colord[open>=close] for open, close in zip(opens, closes) if open!=-1 and close !=-1]

That should read

    colors = [colord[close>=open] for open, close in zip(opens, closes) if open!=-1 and close !=-1]

right? I believe this is already correct in candlestick, so this is a
candlestick2 specific bug.

    > As far as the moving average calculation, I did see the
    > disclaimer and didn't mean to be a stickler, it just seem a
    > bit misleading to me as I was trying to do the Exponential
    > Moving Average calculation and compare the results to the
    > actual financial charts. They didn't match and I thought I
    > would point that out.

OK, if you submit a replacement function that better matches actual
plots, I will be happy to include it.

Thanks for the report!
JDH