Quantitative finance collector
C++ Matlab VBA/Excel Java Mathematica R/Splus Net Code Site Other

Quantitative Finance Collector is a blog on Quantitative finance analysis, financial engineering methods in mathematical finance focusing on derivative pricing, quantitative trading and quantitative risk management. Please help us spread the word:

Apr 19
Data access is a prerequisite to quant finance study, unfortunately, data is not cheap, I once list the sites where we can download free data at financial data download, here is a good free data directory site I came across a few days ago: wikiposit - A searchable directory of numerical data on the internet.

Basically Wikiposit spiders those web sites with data and collects data source information, users can therefore look for their wanted data on one site only. Currently it has about 110,000 data sets, mostly economic and financial. For example, a click on finance section you will notice the following subcategories:
Open in new window

or you can search directly by typing a keyword, take a look if you feel useful, http://wikiposit.org/w
Tags:
Dec 12
Probably all of us have met the issue of handling missing data, from the basic portfolio correlation matrix estimation, to advanced multiple factor analysis, how to impute missing data remains a hot topic. Missing data are unavoidable, and more encompassing than the ubiquitous association of the term, irgoring missing data will generally lead to biased estimates. The following ways are often applied to handle the problem:
1, simple deletion strategies: including pairwise deletion and listwise deletion, the former may lead to inconsistent results, for example, non positive definite correlation or covariance matrices, while the cumulation of deleted cases may be enormous except in the case of very few missing values for the latter method;
2, so called "Working around" strategies, for example, the Full Information Maximum Likelihood (FIML) integrates out the missing data when fitting the desired model;
3, imputation strategies, these are the most widely used methods both in academia and industry, replacing missing value with an estimate of the actual value of that case. For instance, ‘hot-deck’ imputation consists of replacing the missing value by the observed value from another, similar case from the same dataset for which that variable was not missing; mean imputation consists of replacing the missing value by the mean of the variable in question; expectation Maximization (EM) arrives at the best point estimates of the true values, given the model (which itself is estimated on the basis of the imputed missings); regression-mean imputation replaces the missing value by the conditional regression mean, and multiple imputation, rather than a single imputed value, multiple ones are derived from a prediction equation.

I came across an easy-to-use missing data imputation named Amelia II developed by professor Gary King from Harvard university, as its webpage introduces: Amelia II "multiply imputes" missing data in a single cross-section (such as a survey), from a time series (like variables collected for each year in a country), or from a time-series-cross-sectional data set (such as collected by years for each of several countries). Amelia II implements bootstrapping-based algorithm that gives essentially the same answers as the standard IP or EMis approaches, is usually considerably faster than existing approaches and can handle many more variables....Unlike...other statistically rigorous imputation software, it virtually never crashes.
Tags: ,
Nov 17
Wrote a simple script to fetch historical stock data from Yahoo.cn finance and to save as a csv file, please be aware this script is only for those interested into downloading free historical prices of firms listed in Shanghai and Shenzhen stock exchanges only, (indeed not only stock data, but also Chinese warrant data.)  Plese check free real time stock quotes or historial stock price from Yahoo if you prefer non-Chinese stocks.

1, why do I write it since finance.yahoo.com provides such a module already, for instance, by using http://ichart.yahoo.com/table.csv?s=symbol?
Simple, because I found yahoo.com has only closing price dividend-adjusted, which is obviously not enough if your quantitative trading strategies involve historical open, close, high, low data, for example, a widely used stochastic indicator compares current prices to the high and low range over a look-back period, therefore unadjusted high, low data might mistakenly treat a lose strategy as a win strategy. Below are snapshots of stock prces downloaded directly from finance.yahoo.com and from this script, where on 20090610 the stock paid out a dividend.
yahoo chinese stock finance before
yahoo chinese stock finance after

2, you prefer to download historical stock data from Yahoo, dividend info for each stock and adjust the data yourself instead of using this script.
Fine, if you are happy.

3, you have option to download daily, weekly or monthly data using this script, while there is no such an input using http://ichart.yahoo.com/table.csv?s=symbol.
This is another reason I wrote it, please correct me if I am wrong.

How to use the script? by typing the url http://www.mathfinance.cn/yahoo-chinese-stock-quotes.php?stockNo=yourstock&exchange=ss&dateType=yourdate, here yourstock is the symbol of stock to download, ss means shanghai, and sz means shenzhen stock exchange, yourdate has three types: day, week and month for daily, weekly and monthly data, respectively. For instance, http://www.mathfinance.cn/yahoo-chinese-stock-quotes.php?stockNo=600030&exchange=ss&dateType=day will pop up a window asking you to save or open the data in csv. Leave a message here for any error or share with others if it is helpful, thanks.

All stock data is from Yahoo finance China, please obey the policy of Yahoo finance.

The PhP file for this function
Tags: ,
Jul 12
Get your free real time stock quotes here, one of the worlds largest stocks and shares websites. Offering the private investor FREE streaming prices from NASDAQ, NYSE, Dow Jones and many more indices from around the world, We provide free service like Stock Quotes, Watch lists, Charts, Financials News, etc. Being a free member you can access to real-time Dow Jones and NASDAQ indices, FOREX, managed funds, plus delayed US and world markets stock prices and indices. You will also be able to access comprehensive range of free charting, research, news, message boards and stock screening tools.  


free Real-time Stock quotes
The free services includes:
# Quotes
# Comprehensive Java & HTML Charting tools
# Streaming Stock watch lists (monitor)
# Free bulletin boards
# Portfolio
# Stock screening tools (toplists)
# Trades
# Company Financial data
# News
# Alerts
# World market profiles

Please sign up as a free member to download FREE stock quote.
Tags:
Apr 23
A friend of mine asks me how to download stock historical price automatically with Excel, here are two ways I have played:

1, using Excel 2003/2002 Add-in to download from MSN Money Stock Quotes. This add-in for Microsoft Office Excel 2003 and Microsoft Excel 2002 allows you to get dynamic stock quotes from the MSN Money Web site. The add-in allows you to easily gather and study the stocks of interest to you.
http://www.microsoft.com/downloads/details.aspx?FamilyID=485FCCD8-9305-4535-B939-3BF0A740A9B1&displaylang=en

2, using the following macro to download from Yahoo finance. where you have to input start, end date and stock symbol
Sub GetData()

    Dim DataSheet As Worksheet
    Dim EndDate As Date
    Dim StartDate As Date
    Dim Symbol As String
    Dim qurl As String
    Dim nQuery As Name
    
    Application.ScreenUpdating = False
    Application.DisplayAlerts = False
    Application.Calculation = xlCalculationManual
    
    Set DataSheet = ActiveSheet
  
        StartDate = DataSheet.Range("B1").Value
        EndDate = DataSheet.Range("B2").Value
        Symbol = DataSheet.Range("B3").Value
        Range("C7").CurrentRegion.ClearContents
        
        qurl = "http://ichart.yahoo.com/table.csv?s=" & Symbol
        qurl = qurl & "&a=" & Month(StartDate) - 1 & "&b=" & Day(StartDate) & _
            "&c=" & Year(StartDate) & "&d=" & Month(EndDate) - 1 & "&e=" & _
            Day(EndDate) & "&f=" & Year(EndDate) & "&g=" & Range("E3") & "&q=q&y=0&z=" & _
            Symbol & "&x=.csv"
        Range("b5") = qurl
                  
QueryQuote:
             With ActiveSheet.QueryTables.Add(Connection:="URL;" & qurl, Destination:=DataSheet.Range("C7"))
                .BackgroundQuery = True
                .TablesOnlyFromHTML = False
                .Refresh BackgroundQuery:=False
                .SaveData = True
            End With
            
            Range("C7").CurrentRegion.TextToColumns Destination:=Range("C7"), DataType:=xlDelimited, _
                TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
                Semicolon:=False, Comma:=True, Space:=False, other:=False
            
            Range(Range("C7"), Range("C7").End(xlDown)).NumberFormat = "mmm d/yy"
            Range(Range("D7"), Range("G7").End(xlDown)).NumberFormat = "0.00"
            Range(Range("H7"), Range("H7").End(xlDown)).NumberFormat = "0,000"
            Range(Range("I7"), Range("I7").End(xlDown)).NumberFormat = "0.00"

End Sub


In Matlab there is build-in function named "fetch" for requesting data from Yahoo! data servers.
Tags: ,
Pages: 3/4 First page Previous page 1 2 3 4 Next page Final page [ View by Articles | List ]