Monday, May 11, 2009

Playing With the Python Imaging Library (PIL)

I wanted to graph some stock transaction data for the little bit of money that I have in a Roth IRA. I couldn't figure out how to get pychart to do what I wanted. So, I installed PIL and was able to produce the above with this python script.

The gray rectangles are the stock's price range for a day of trading. Red circles are purchases. Blue circles are sells. Circle size is proportional to the amount of the transaction. The littlest red circles are automatic purchases of $400 worth of stock made every Tuesday (with a $4 transaction cost).

I really missed the chance to make a lot of money when I sold where the biggest blue circle is. = (

No comments: