473,405 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Python stock market analysis tools?

I have done a bit of searching and can't seem to find a stock market
tool written in Python that is active. Anybody know of any? I'm trying
not to re-create the wheel here.

Mar 5 '07 #1
5 7476
On Mar 4, 7:52 pm, "Mudcat" <mnati...@gmail.comwrote:
I have done a bit of searching and can't seem to find a stock market
tool written in Python that is active. Anybody know of any? I'm trying
not to re-create the wheel here.
What kind of tool do you want? Getting quotes is the easy part:

import urllib
symbols = 'ibm jpm msft nok'.split()
quotes = urllib.urlopen( 'http://finance.yahoo.com/d/quotes.csv?s=' +
'+'.join(symbols) + '&f=l1&e=.csv').read().split()
print dict(zip(symbols, quotes))

The hard part is raising capital and deciding what to buy, sell, or
hold.
Raymond

Mar 5 '07 #2
Dag
On 4 Mar 2007 19:52:56 -0800, Mudcat <mn******@gmail.comwrote:
I have done a bit of searching and can't seem to find a stock market
tool written in Python that is active. Anybody know of any? I'm trying
not to re-create the wheel here.
Depends on what you mean by stock market tool. There's http://ta-lib.org
which while written in C++ claims to have a python wrapper. That being
said last time I looked at it I couldn't get the python binding working,
but I didn't spend much time on it.

Dag
Mar 5 '07 #3
On Mar 5, 12:41 am, "Raymond Hettinger" <pyt...@rcn.comwrote:
On Mar 4, 7:52 pm, "Mudcat" <mnati...@gmail.comwrote:
I have done a bit of searching and can't seem to find a stock market
tool written in Python that is active. Anybody know of any? I'm trying
not to re-create the wheel here.

What kind of tool do you want? Getting quotes is the easy part:

import urllib
symbols = 'ibm jpm msft nok'.split()
quotes = urllib.urlopen( 'http://finance.yahoo.com/d/quotes.csv?s='+
'+'.join(symbols) + '&f=l1&e=.csv').read().split()
print dict(zip(symbols, quotes))

The hard part is raising capital and deciding what to buy, sell, or
hold.
Yes, and a discussion of investment approaches would be off-topic.
Unfortunately, newsgroups such as misc.invest.stocks are dominated by
spam -- the moderated newsgroup misc.invest.financial-plan is better.

Some research says that "mean variance portfolio optimization" can
give good results. I discussed this in a message

http://groups.google.com/group/misc....c?dmode=source
Newsgroups: misc.invest.financial-plan
From: be*******@aol.com
Date: Mon, 26 Feb 2007 12:47:25 -0600
Local: Mon, Feb 26 2007 1:47 pm
Subject: Re: Portfolio Optimization Software?

To implement this approach, a needed input is the covariance matrix of
returns, which requires historical stock prices, which one can obtain
using "Python quote grabber" http://www.openvest.org/Databases/ovpyq .

For expected returns -- hmmm. One of the papers I cited found that
assuming equal expected returns of all stocks can give reasonable
results.

Then one needs a "quadratic programming" solver, which appears to be
handled by the CVXOPT Python package.

If someone implements the approach in Python, I'd be happy to hear
about it.

There is a "backtest" package in R (open source stats package callable
from Python) http://cran.r-project.org/src/contri.../backtest.html
"for exploring portfolio-based hypotheses about financial instruments
(stocks, bonds, swaps, options, et cetera)."

Mar 5 '07 #4
What kind of tool do you want? Getting quotes is the easy part:

import urllib
symbols = 'ibm jpm msft nok'.split()
quotes = urllib.urlopen( 'http://finance.yahoo.com/d/quotes.csv?s='+
'+'.join(symbols) + '&f=l1&e=.csv').read().split()
print dict(zip(symbols, quotes))

The hard part is raising capital and deciding what to buy, sell, or
hold.

Raymond
Yeah, I have something that pulls quotes. So the data isn't hard to
get, but I'm not really interested in building the graphs. I was
hoping to find something already built with the common indicators
already built in that I could add my own to.

Mar 5 '07 #5
On Mar 5, 7:55 am, "Beliavsky" <beliav...@aol.comwrote:
Yes, and a discussion of investment approaches would be off-topic.
Unfortunately, newsgroups such as misc.invest.stocks are dominated by
spam -- the moderated newsgroup misc.invest.financial-plan is better.

Some research says that "mean variance portfolio optimization" can
give good results. I discussed this in a message
I actually checked out some of those newsgroups in trying to find a
tool to use. I think I even posted a question about it. But you're
right in that there's so much spam, and all of the responses I got
were people trying to hock their own wares. Didn't find much in the
way of useful information.
Mar 5 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

52
by: Olivier Scalbert | last post by:
Hello , What is the python way of doing this : perl -pi -e 's/string1/string2/' file ? Thanks Olivier
0
by: Tim Churches | last post by:
The following notice about Geographic Info systems posts appeared in my in-box: > Research Associate - GIS and Health (2 Posts) Department of Geography, > University of Canterbury, New Zealand >...
30
by: Stuart Turner | last post by:
Hi Everyone, I'm working hard trying to get Python 'accepted' in the organisation I work for. I'm making some good in-roads. One chap sent me the text below on his views of Python. I wondered...
99
by: Shi Mu | last post by:
Got confused by the following code: >>> a >>> b >>> c {1: , ], 2: ]} >>> c.append(b.sort()) >>> c {1: , ], 2: , None]}
16
by: Roman Susi | last post by:
Hi! Out of curiosity, how do I draw functions outside classes with UML? How module could be drawn in this case? More theoretical question is if I create classes on the fly, how UML can...
29
by: 63q2o4i02 | last post by:
Hi, I'm interested in using python to start writing a CAD program for electrical design. I just got done reading Steven Rubin's book, I've used "real" EDA tools, and I have an MSEE, so I know what...
0
by: L'eau Prosper Research | last post by:
Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases new TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set. L'eau Prosper Market...
0
by: L'eau Prosper Research | last post by:
NEW TradeStation 8 Add-on - L'eau Prosper Market Manipulation Profiling Tools Set By L'eau Prosper Research Press Release: L'eau Prosper Research (Website: http://www.leauprosper.com) releases...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.