Introduction

236 views
Skip to first unread message

Paul English

unread,
Feb 13, 2011, 9:29:49 PM2/13/11
to sage-finance
Hi Folks,

This group seems to have been idle for a while, but I thought I
would introduce myself and see if anyone else out there shared some
interests and perhaps we can get some development going in the
quantitative finance domain.

I'm much more interested in currency data than Stocks, so I'd like to
have a sage.finance.FX (Forex? Currency?). Yahoo Finance supplies this
data, but sage.finance.Stock fails when fed a currency pair symbol:

finance.Stock('EURUSD').yahoo()

{'stock_exchange': '"N/A"', 'market_cap': 'N/A', '200day_moving_avg':
'N/A', '52_week_high': 'N/A', 'price_earnings_growth_ratio': 'N/A',
'price_sales_ratio': 'N/A', 'price': '0.00', 'earnings_per_share':
'N/A', '50day_moving_avg': 'N/A', 'avg_daily_volume': '0', 'volume':
'N/A', '52_week_low': 'N/A', 'short_ratio': 'N/A',
'price_earnings_ratio': 'N/A', 'dividend_yield': 'N/A',
'dividend_per_share': 'N/A', 'price_book_ratio': 'N/A', 'ebitda': 'N/
A',
'change': 'N/A', 'book_value': 'N/A'}

(Currency rates are always quoted as pairs)

I imagine it would be fairly easy to modify the existing finance.Stock
class to create a Forex class and have it supply all the same methods.
Volume would need to be ignored as that is not typically available for
Forex.

Along the currency theme, I'm also trying to convert the ~9GB/10 years
of zipped csv GAIN Forex data:
http://ratedata.gaincapital.com/
from ticks into various candlesticks values. While
sage.finance.timeseries will display a Candlestick chart, it doesn't
currently output candlestick values as far as I can tell. Again it
seems like it should be a fairly easy modification, since
plot_candlestick() already needs to do the conversion in order to plot
the candlesticks.

Then generally I'm interested in getting access to more common
technical indicators (stochastics, Bollinger bands...), both for
Stocks and Forex in SAGE. It may be that those already exist via R
libraries, or in completely other domains, so I'm still exploring.

I graduated with my Bachelor of Science in Computer Science in 1998
from Worcester Polytechnic Institute, but since then I've been a
Systems Administrator and now I'm a lofty IT Director (as in, I do
some IT, and spend more time in meetings than a normal sysadmin) -
meaning my math and programming skills have atrophied somewhat, and
I've never done any programming professionally aside from smallish
scripts.

Still - I've always been excited about open source (which has backed a
non-trivial amount of my career), and recently about Forex and Sage.

William Stein

unread,
Feb 14, 2011, 2:45:45 AM2/14/11
to sage-f...@googlegroups.com
On Sun, Feb 13, 2011 at 6:29 PM, Paul English <peng...@gmail.com> wrote:
> Hi Folks,
>
>   This group seems to have been idle for a while, but I thought I
> would introduce myself and see if anyone else out there shared some
> interests and perhaps we can get some development going in the
> quantitative finance domain.
>
> I'm much more interested in currency data than Stocks, so I'd like to
> have a sage.finance.FX (Forex? Currency?). Yahoo Finance supplies this
> data, but sage.finance.Stock fails when fed a currency pair symbol:
>
> finance.Stock('EURUSD').yahoo()
>
> {'stock_exchange': '"N/A"', 'market_cap': 'N/A', '200day_moving_avg':
> 'N/A', '52_week_high': 'N/A', 'price_earnings_growth_ratio': 'N/A',
> 'price_sales_ratio': 'N/A', 'price': '0.00', 'earnings_per_share':
> 'N/A', '50day_moving_avg': 'N/A', 'avg_daily_volume': '0', 'volume':
> 'N/A', '52_week_low': 'N/A', 'short_ratio': 'N/A',
> 'price_earnings_ratio': 'N/A', 'dividend_yield': 'N/A',
> 'dividend_per_share': 'N/A', 'price_book_ratio': 'N/A', 'ebitda': 'N/
> A',
> 'change': 'N/A', 'book_value': 'N/A'}
>
> (Currency rates are always quoted as pairs)
>
> I imagine it would be fairly easy to modify the existing finance.Stock
> class to create a Forex class and have it supply all the same methods.
> Volume would need to be ignored as that is not typically available for
> Forex.

I agree. I think it would be great if you could add this
functionality. How to do so is explained in the Sage Developer's
guide:

http://sagemath.org/doc/developer/

> Along the currency theme, I'm also trying to convert the ~9GB/10 years
> of zipped csv GAIN Forex data:
> http://ratedata.gaincapital.com/
> from ticks into various candlesticks values. While
> sage.finance.timeseries will display a Candlestick chart, it doesn't
> currently output candlestick values as far as I can tell. Again it
> seems like it should be a fairly easy modification, since
> plot_candlestick() already needs to do the conversion in order to plot
> the candlesticks.

That's also a great idea. I think the TimeSeries code is pretty
straightforward (it's just simple Cython code). I wrote most of it,
so if you have questions, don't hesitate to ask.

> Then generally I'm interested in getting access to more common
> technical indicators (stochastics, Bollinger bands...), both for
> Stocks and Forex in SAGE. It may be that those already exist via R
> libraries, or in completely other domains, so I'm still exploring.

I'm sure they do. There can be some advantages to adding them to
TimeSeries, e.g., speed.

> I graduated with my Bachelor of Science in Computer Science in 1998
> from Worcester Polytechnic Institute, but since then I've been a
> Systems Administrator and now I'm a lofty IT Director (as in, I do
> some IT, and spend more time in meetings than a normal sysadmin) -
> meaning my math and programming skills have atrophied somewhat, and
> I've never done any programming professionally aside from smallish
> scripts.

I predict that contributing to Sage could be the funnest thing you do
for a while :-)

> Still - I've always been excited about open source (which has backed a
> non-trivial amount of my career), and recently about Forex and Sage.

>
> --
> You received this message because you are subscribed to the Google Groups "sage-finance" group.
> To post to this group, send email to sage-f...@googlegroups.com.
> To unsubscribe from this group, send email to sage-finance...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/sage-finance?hl=en.
>
>

--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org

Reply all
Reply to author
Forward
0 new messages