30Jul/090
既然是赌,为啥不选中建
昨天大盘泻了5个点,亏了1w多,白天开始想着是不是要换个股票了,早上做了点功课,10点半把手上的002011换了,进了1w中建,11点大盘的向下算是躲过去了。不知道这么做是不是对的,不过既然换了就无所谓了。
说说对中建的感觉吧。
大家讨论的多是中建现在的PE,75,比较起08年的0.14,我还是更愿意用07年的0.29作为基准,这样的话就是25左右了,和万科也差不了多少了。自己估摸着今年那么多项目上马,中建建筑业的业绩应该不会比以前少的,而房地产的火热也差不过能提供07年的利润了吧。
网上说中建建筑,房产,其他的比例是8:1:1,利润上建筑之有0.48.房产有了0.41,自己估摸着要是我不傻的话我也会多投房产的,看老总说的3:6:1的远期规划,把我吓了一跳的,这个建筑的总量应该不会变太多的吧,如果房产上升到6的话,这个量就有点吓人了,虽然说中建现在是要地有地,要钱有钱,要人有人的,可是这种扩张速度还是让人可怕。这应该就是老总说的保持8个点到2020的底气了
我自己觉得,短时间如果开始转向做房产的话,业绩提高个一倍还是有可能的。2年之内,0.4的业绩还是可能实现的。
30的PE的话,7块的价格也就不算高了.
机构的人应该比我算的更好吧,我估摸着和预期赌那些小公司,不如赌这个了。新股嘛,里面大家至少都知道成本所在的。
祝好吧。
26Jul/090
stock his data 的获得(Pj-02)
按照之前的想法,今天做了stock history的数据的获得。所用的stock
是用的google中的china资产组合,不过其中有一些好像在yahoo
finance中没有历史数据,所以没有办法用这个办法得到结果,list总共是146家中国的股票,在所有的中国股票中除去了(YTEC,ASTTY,ORS,PACT,MGH,ADL,ATYM,CRGIY)这些股票大多是股价在1.00以类或者yahoo上没有历史记录的。我也没有去看那个list上的中国公司都有些那的,不过样本就用这146吧。
是用的google中的china资产组合,不过其中有一些好像在yahoo
finance中没有历史数据,所以没有办法用这个办法得到结果,list总共是146家中国的股票,在所有的中国股票中除去了(YTEC,ASTTY,ORS,PACT,MGH,ADL,ATYM,CRGIY)这些股票大多是股价在1.00以类或者yahoo上没有历史记录的。我也没有去看那个list上的中国公司都有些那的,不过样本就用这146吧。
最主要的问题在于这些得到的数据的格式,因为在04年到现在的这些股票,他们的交易日期其实很不一样,最normal的股票有1414个交易日,不过很多股票没有这个数,有些甚至只有300多天,而且我是按照list的顺序存在几个变量中的,变量作为一个2为数组A(a,b)其中A(:,b)代表的是在list中b位置的历史数值,由于中间可能存在一些数据个数的不一样,我们得到的数据维数其实是很不规则的,这个在后面的处理中还要好好倒腾下了。
另外的问题就是这个速度太慢了,由于这个method是建立在load进入网页后读取网页编码的办法,理论上load进去网络就决定了函数的运行速度,我们家的adsl
无线网,一个stock的处理要14s左右,运行所有的要35分钟,还有就是程序中没有错误处理的解决,我是自己一个个load后发现有些没与历史数据而强行终止的得到的,不过再往后就不可能再是这样了,试试建立一个错误的处理过程。
无线网,一个stock的处理要14s左右,运行所有的要35分钟,还有就是程序中没有错误处理的解决,我是自己一个个load后发现有些没与历史数据而强行终止的得到的,不过再往后就不可能再是这样了,试试建立一个错误的处理过程。
速度太慢了,甚至让我有放弃的感觉了。痛苦啊。
PS:最后下载数据的时候还是出错了,我一直觉得是我用的组合有问题,那个上面不仅仅有nyse
nasdaq还有一些otc的,于是上nyse下了一个china的list
45+搜罗了nasdaq的总共是109个。尝试用新的再做一次了。
nasdaq还有一些otc的,于是上nyse下了一个china的list
45+搜罗了nasdaq的总共是109个。尝试用新的再做一次了。
接下来就是建立一个数据库吧这些数据都放进去,为什么要是数据库其他的不行吗?我琢磨了下,因为我想把历史数据和option数据都放进去,所以还是试试用数据库吧,excel和access缓缓把,用的Sql,怎么建,google大神了。
下面是历史数据的主程序了
% A function for get the stock history price in the
internet.
% whool.net
internet.
% whool.net
% step1 load the list of stock from txt.
function [HIS_DATE, HIST_HIGH, HIST_LOW, HIST_OPEN, HIST_CLOSE,
HIST_VOL] =PJ_HIS _STOCK (STOCK_LIST)
for i=1:146
[hist_date, hist_high, hist_low, hist_open,
hist_close,
hist_vol,ptr] = get_hist _stock _data (STOCK_LIST (i))
HIS_DATE (1:ptr-1,i)=hist_date
(:,1);
HIST_HIGH (1:ptr-1,i)=hist_high
(:,1);
HIST_LOW (1:ptr-1,i)=hist_low
(:,1);
HIST_OPEN (1:ptr-1,i)=hist_open
(:,1);
HIST_CLOSE (1:ptr-1,i)=hist_close
(:,1);
HIST_VOL (1:ptr-1,i)=hist_vol
(:,1);
clear hist_date hist_high hist_low hist_open
hist_close hist_vol
ptr
end
end
function [HIS_DATE, HIST_HIGH, HIST_LOW, HIST_OPEN, HIST_CLOSE,
HIST_VOL] =PJ_HIS _STOCK (STOCK_LIST)
for i=1:146
[hist_date, hist_high, hist_low, hist_open,
hist_close,
hist_vol,ptr] = get_hist _stock _data (STOCK_LIST (i))
HIS_DATE (1:ptr-1,i)=hist_date
(:,1);
HIST_HIGH (1:ptr-1,i)=hist_high
(:,1);
HIST_LOW (1:ptr-1,i)=hist_low
(:,1);
HIST_OPEN (1:ptr-1,i)=hist_open
(:,1);
HIST_CLOSE (1:ptr-1,i)=hist_close
(:,1);
HIST_VOL (1:ptr-1,i)=hist_vol
(:,1);
clear hist_date hist_high hist_low hist_open
hist_close hist_vol
ptr
end
end
25Jul/090
Statistical Significance and the Magic Formula
It’s been a while since I first read Joel Greenblatt’s
The Little Book That Beats the Market
, and was bowled over by his Magic Formula’s historical returns versus the
S&P 500 …
The Little Book That Beats the Market
S&P 500 …
But one thing that bothered me when reading Greenblatt’s book
was my memory of the Foolish Four. It was a similar market-trouncing “magic
formula” that gained popularity in the late 90’s, only to later be
discredited and deemed an artifact of data-mining.
was my memory of the Foolish Four. It was a similar market-trouncing “magic
formula” that gained popularity in the late 90’s, only to later be
discredited and deemed an artifact of data-mining.
My understanding of how the wind was taken out of the Foolish
Four’s sails was by investigating its performance over a longer
time period. For example, it’s yearly excess return over the
Dow goes from 10% to something closer to 2% when back-tested over
50 years instead of the original 20 years. So of course that
becomes an undeniable hintergedanke when seeing the Magic Formula’s
measly 17-year sample size.
Four’s sails was by investigating its performance over a longer
time period. For example, it’s yearly excess return over the
Dow goes from 10% to something closer to 2% when back-tested over
50 years instead of the original 20 years. So of course that
becomes an undeniable hintergedanke when seeing the Magic Formula’s
measly 17-year sample size.
And for those hung up on the fact that even a 2% alpha is
respectable for the Foolish Four, it shrinks even further when you
factor in the capital gains incurred by having to shuffle the deck,
as it were, each year.
respectable for the Foolish Four, it shrinks even further when you
factor in the capital gains incurred by having to shuffle the deck,
as it were, each year.
Learning quantitative techniques to analyze problems such as
these (i.e. is 17 years worth of data enough to conclude that the
Magic Formula outperforms the S&P 500?) is exactly
why I enrolled in the CFA
program. And after getting a couple hundred pages into the
first study guide at Level One, they cover precisely this sort of
conundrum.
these (i.e. is 17 years worth of data enough to conclude that the
Magic Formula outperforms the S&P 500?) is exactly
why I enrolled in the CFA
program. And after getting a couple hundred pages into the
first study guide at Level One, they cover precisely this sort of
conundrum.
So here is how it works. We do what is called a hypothesis
test in statistics, whereby we hypothesize that the average
return of the Magic Formula and the S&P 500 are
actually identical! And then we do a few computations based on
confidence intervals to see whether we can
reject that hypothesis or not, and with what degree of confidence.
As a big fan of the Magic Formula, I have to say I’m secretly
hoping that it does have a statistically significant higher
average yearly return than the S&P 500…
test in statistics, whereby we hypothesize that the average
return of the Magic Formula and the S&P 500 are
actually identical! And then we do a few computations based on
confidence intervals to see whether we can
reject that hypothesis or not, and with what degree of confidence.
As a big fan of the Magic Formula, I have to say I’m secretly
hoping that it does have a statistically significant higher
average yearly return than the S&P 500…
First, Some Assumptions…
Now in order to proceed, we have to make two assumptions. The first
is that the yearly returns of these two investing techniques follow
a mostly normal distribution. We’re supposed to feel comfortable
making this assumption due to the central limit theorem. Briefly, it says that
the distribution of any variable that is a function of a bunch of
other random variables always tends to end up looking like a bell
curve.
Now in order to proceed, we have to make two assumptions. The first
is that the yearly returns of these two investing techniques follow
a mostly normal distribution. We’re supposed to feel comfortable
making this assumption due to the central limit theorem. Briefly, it says that
the distribution of any variable that is a function of a bunch of
other random variables always tends to end up looking like a bell
curve.
The second assumption we’ll make is that the returns of the
Magic Formula and S&P 500 are not
independent. The CFA study guide advises that when comparing
two investing strategies covering the same period of time, the
returns of both depend on the same underlying market and
economic forces present at that time, and therefore have some
things in common.
Magic Formula and S&P 500 are not
independent. The CFA study guide advises that when comparing
two investing strategies covering the same period of time, the
returns of both depend on the same underlying market and
economic forces present at that time, and therefore have some
things in common.
Step #1: Sample Mean
Difference
The first step is to compute the average difference of the yearly
returns between the two strategies. This turns out to be
19.04%.
Difference
The first step is to compute the average difference of the yearly
returns between the two strategies. This turns out to be
19.04%.
Step #2: Standard Error of
the Mean Difference
Next we compute the sample standard deviation of the difference (in
Excel, use stdev). This comes out to be 22.24%. We transform
this into standard error of the mean difference (SEMD) by dividing
by the square root of the sample size. The years 1988-2004 comprise
17 years.
the Mean Difference
Next we compute the sample standard deviation of the difference (in
Excel, use stdev). This comes out to be 22.24%. We transform
this into standard error of the mean difference (SEMD) by dividing
by the square root of the sample size. The years 1988-2004 comprise
17 years.
Step #3: Compute Test
Statistic
For normal, or mostly normal distributions and small sample sizes
we use the t-test to check for statistical significance.
Basically this just gives us a number that we can compare to a
t-test table in order to determine whether the difference we’re
seeing between the Magic Formula and S&P 500
appears to be important given the sample size. The smaller the
sample size, the greater the t-test hurdle our data will have to
clear in order to be able to conclude that the two don’t have the
same mean.
Statistic
For normal, or mostly normal distributions and small sample sizes
we use the t-test to check for statistical significance.
Basically this just gives us a number that we can compare to a
t-test table in order to determine whether the difference we’re
seeing between the Magic Formula and S&P 500
appears to be important given the sample size. The smaller the
sample size, the greater the t-test hurdle our data will have to
clear in order to be able to conclude that the two don’t have the
same mean.
The test statistic is simply the sample mean difference minus
the hypothesized mean difference, divided by the SEMD.
the hypothesized mean difference, divided by the SEMD.
Step #4: Pick a Significance
Level and Compare
Finally we need to decide on a level of significance and do our
table compare. Most of these sorts of tests in the CFA curriculum
seem to use 5%. This means that in our comparison, there will only
be a 5% chance that there is in reality no difference
between the Magic Formula and S&P 500, but we fail
to detect this.
Level and Compare
Finally we need to decide on a level of significance and do our
table compare. Most of these sorts of tests in the CFA curriculum
seem to use 5%. This means that in our comparison, there will only
be a 5% chance that there is in reality no difference
between the Magic Formula and S&P 500, but we fail
to detect this.
In addition to level of significance, the only other parameter
we require to do our table look-up is the degrees of
freedom. But that’s easy as it’s simply the sample size minus
1.
we require to do our table look-up is the degrees of
freedom. But that’s easy as it’s simply the sample size minus
1.
Given these two parameters we could now find a t-test table to do a critical value look-up,
but this can be a little tedious, not to mention the additional
step of converting one-sided to two-sided. I prefer to just use
Excel’s tinv function.
but this can be a little tedious, not to mention the additional
step of converting one-sided to two-sided. I prefer to just use
Excel’s tinv function.
tinv(probability,deg_freedom) = tinv(.05, 17-1) =
2.120
2.120
And since our t-value from Step #3 was 3.526, which is much
> 2.120 we can easily reject the hypothesis that the
means are equal at the 5% level of significance. Not only that, we
can assume the means are different by as much as 7.59%
before we start running up against our critical value of
2.120.
> 2.120 we can easily reject the hypothesis that the
means are equal at the 5% level of significance. Not only that, we
can assume the means are different by as much as 7.59%
before we start running up against our critical value of
2.120.
So the Magic Formula’s outperformance appears not to just be
an artifact of small sample size, and also appears to be of
significant magnitude.
an artifact of small sample size, and also appears to be of
significant magnitude.
But What About Risk?
Things are truly looking rosy for the Magic Formula. But a seasoned
finance student will also compare the standard deviations of yearly
returns in our first table up top and notice that the Magic
Formula’s is higher (24.26% versus 17.87%). Standard deviation is a
common (though debatable) quantifier for risk so it wouldn’t be
uncommon to argue that the Magic Formula should have higher
returns to compensate the investor for taking more risk.
Things are truly looking rosy for the Magic Formula. But a seasoned
finance student will also compare the standard deviations of yearly
returns in our first table up top and notice that the Magic
Formula’s is higher (24.26% versus 17.87%). Standard deviation is a
common (though debatable) quantifier for risk so it wouldn’t be
uncommon to argue that the Magic Formula should have higher
returns to compensate the investor for taking more risk.
Well just as we tested the hypothesis that the means
were equal, we can do the same with variance (square of standard
deviation)…
were equal, we can do the same with variance (square of standard
deviation)…
Step #5: Test Equality of
Two Variances
I’ll cut to the chase here just to say that there’s a simple
equivalent of the t-test when testing for the equality of two
variances, and it’s called the F-test.
Two Variances
I’ll cut to the chase here just to say that there’s a simple
equivalent of the t-test when testing for the equality of two
variances, and it’s called the F-test.
We come up with our F parameter by just computing the ratio of
the two variances.
the two variances.
And again we could do a manual look-up using an F-table, but
why not just let Excel compute it for us with finv….
why not just let Excel compute it for us with finv….
finv(probability, deg_freedom1, deg_freedom2) = finv(.05,
16, 16) = 2.333
16, 16) = 2.333
Therefore at the 5% significance level, because 1.843
< 2.333 we cannot reject the hypothesis that the
variances are the same.
< 2.333 we cannot reject the hypothesis that the
variances are the same.
Summary
In conclusion, past performance may be no indication of future
results… blah blah blah… The important thing is that the Magic
Formula points toward having the best of both worlds, a
statistically significant higher annual rate of return versus the
S&P 500 without a statistically significant higher
level of risk. Win-win!
In conclusion, past performance may be no indication of future
results… blah blah blah… The important thing is that the Magic
Formula points toward having the best of both worlds, a
statistically significant higher annual rate of return versus the
S&P 500 without a statistically significant higher
level of risk. Win-win!
It is interesting to see how confidence intervals allow us to
tread into gray areas. A newbie might stop at Step #1 and claim
that the Magic Formula beats the S&P 500 by an
average of 19.04% per year. His antagonist might point to the small
sample size and say that it makes that 19.04% estimate of mean…
meaningless! But a statistician can state that he’s 95% sure that
the Magic Formula outperforms the S&P 500 by at
least 7.59% per year…. assuming normality.
tread into gray areas. A newbie might stop at Step #1 and claim
that the Magic Formula beats the S&P 500 by an
average of 19.04% per year. His antagonist might point to the small
sample size and say that it makes that 19.04% estimate of mean…
meaningless! But a statistician can state that he’s 95% sure that
the Magic Formula outperforms the S&P 500 by at
least 7.59% per year…. assuming normality.
And much is indeed hinging upon our assumption of normality,
which can and should be tested for. But that’s for another day…
which can and should be tested for. But that’s for another day…
25Jul/090
quantlib 基础
The Quantlib project is aimed at providing a comprehensive
software framework for quantitative finance. QuantLib is a freeopen-source
library for modeling, trading, and risk management in
real-life.
software framework for quantitative finance. QuantLib is a freeopen-source
library for modeling, trading, and risk management in
real-life.
To help create a community around Quantlib, we have created a
page
QuantlibUniversity.
page
QuantlibUniversity.
QuantLib is written in C++ with a clean object model, and is
then exported to different languages such as Python, Ruby, and
Scheme. An initial Excel add-in is also available. There are ports
to the .NET framework in C# (http://www.quantlib.net"
and http://www.capetools.net/).
Bindings to other languages (including Java), and porting to ddd,
Matlab/Octave, S-PLUS/R,
Mathematica,
COM/CORBA/SOAP architectures,
FpML, are under consideration. See the
extensions page for details.
then exported to different languages such as Python, Ruby, and
Scheme. An initial Excel add-in is also available. There are ports
to the .NET framework in C# (http://www.quantlib.net"
and http://www.capetools.net/).
Bindings to other languages (including Java), and porting to ddd,
Matlab/Octave, S-PLUS/R,
Mathematica,
COM/CORBA/SOAP architectures,
FpML, are under consideration. See the
extensions page for details.
Appreciated by quantitative analysts and developers, it is
intended for academics and practitioners alike, eventually
promoting a stronger interaction between them. QuantLib offers
tools that are useful both for practical implementation and for
advanced modeling, with features such as market conventions, yield
curve models, solvers, PDEs, Monte Carlo (low-discrepancy
included), exotic options, VAR, and so on.
intended for academics and practitioners alike, eventually
promoting a stronger interaction between them. QuantLib offers
tools that are useful both for practical implementation and for
advanced modeling, with features such as market conventions, yield
curve models, solvers, PDEs, Monte Carlo (low-discrepancy
included), exotic options, VAR, and so on.
Finance is an area where well-written open-source projects
could make a tremendous difference:
could make a tremendous difference:
any financial institution needs a solid, time-effective,
operative implementation of cutting edge pricing models and hedging
tools. However, to get there, one is currently forced to re-invent
the wheel every time. Even standard decade-old models, such as
Black-Scholes, still lack a public robust implementation. As a
consequences many good quants are wasting their time writing C++
classes which have been already written thousands of times.
By designing and building these tools in the open, QuantLib will
both encourage peer review of the tools themselves, and demonstrate
how this ought to be done for scientific and commercial software.
Dan Gezelter’s talk<
at the first Open Source/Open Science conference discussed how the
scientific tradition of peer review fits well with the philosophy
of the Open Source movement. Open standards are the only fair way
for science and technology to evolve.
The library could be exploited across different research and
regulatory institutions, banks, software companies, and so on.
Being a free/open-source project, quants contributing to the
library would not need to start from scratch every time.
Students could master a library that is actually used in the real
world and contribute to it in a meaningful way. This would
potentially place them in a privileged position on the job
market.
Researchers would have a framework at hand, which vastly reduces
the amount of low-level work necessary to build models, so to be
able to focus on more complex and interesting problems.
Financial firms could exploit QuantLib as base code and/or
benchmark, while being able to engage in creating more innovative
solutions that would make them more competitive on the
market.
Regulatory institutions may have a tool for standard pricing and
risk management practices.
operative implementation of cutting edge pricing models and hedging
tools. However, to get there, one is currently forced to re-invent
the wheel every time. Even standard decade-old models, such as
Black-Scholes, still lack a public robust implementation. As a
consequences many good quants are wasting their time writing C++
classes which have been already written thousands of times.
By designing and building these tools in the open, QuantLib will
both encourage peer review of the tools themselves, and demonstrate
how this ought to be done for scientific and commercial software.
Dan Gezelter’s talk<
at the first Open Source/Open Science conference discussed how the
scientific tradition of peer review fits well with the philosophy
of the Open Source movement. Open standards are the only fair way
for science and technology to evolve.
The library could be exploited across different research and
regulatory institutions, banks, software companies, and so on.
Being a free/open-source project, quants contributing to the
library would not need to start from scratch every time.
Students could master a library that is actually used in the real
world and contribute to it in a meaningful way. This would
potentially place them in a privileged position on the job
market.
Researchers would have a framework at hand, which vastly reduces
the amount of low-level work necessary to build models, so to be
able to focus on more complex and interesting problems.
Financial firms could exploit QuantLib as base code and/or
benchmark, while being able to engage in creating more innovative
solutions that would make them more competitive on the
market.
Regulatory institutions may have a tool for standard pricing and
risk management practices.
The
QuantLiblicense
is a modified BSD license suitable for use in both free software
and proprietary applications, imposing no constraints at all on the
use of the library.
QuantLiblicense
is a modified BSD license suitable for use in both free software
and proprietary applications, imposing no constraints at all on the
use of the library.
A few companies have committed significant resources to the
development of this library, notably StatPro Italia, a
leading risk-management consulting firm in Italy, where the
QuantLib project was born and the Globewide Network
Academy, a non-profit organization whose goal is to promote
open source and distance education and scholarship.
development of this library, notably StatPro Italia, a
leading risk-management consulting firm in Italy, where the
QuantLib project was born and the Globewide Network
Academy, a non-profit organization whose goal is to promote
open source and distance education and scholarship.
Help deciding the development road-map and start contributing
to the library: the
project-overview page gives a summary of the work in progress.
Documentation
is also available.
to the library: the
project-overview page gives a summary of the work in progress.
Documentation
is also available.
Feedback and questions concerning this site and project can be
directed to the
QuantLib-users mailing list.
directed to the
QuantLib-users mailing list.
25Jul/090
stock data 和 option data的一些想法和实现的可能(1)
题记:
其实有这个想法是很久以来的事情了,不过一直没有去做,说是自己不会也好,自己说说而且也好,不过事实是虽然我想了不少,也花了不少时间,但一直没有好好的做过。因为如果我真的能够完成这个想法的话,我就不会像现在这样为实习和工作的事情发愁了,这中间的东西乱七八糟的,好多东西就是一个想法,没有办法好好的完成。现在把思路理顺一下,看今后这段时间有没有机会把这个东西做出来,纯属研究和学习而已。
这个计划的最终目标是建立一个自己的股票和option价格的数据库,并尝试建立一些模型从这些历史数据中能自动选出一些有一定特征值的股票,现在的我还没有想好最后得到数据后该怎么样使用,和用一些什么样的工具来进行分析.
计划的第一步还是数据的获得,由于一直以来的想法,我没有去找收费网站获得数据的途径,一个原因是挺贵的,还有一个原因就是自己还是想借这个机会学点东西,作出一些东西,也让自己给自己一点信心.
前几天我想着把所有NYSE
NASDAQ
AMEX的股票list都弄下来,然后做一个所有的数据,后来发现中间的数据太多,要处理的小问题也太麻烦,所以现在尝试做的应该只限定在我以前在google
finance上建立的china的组合,大概在150个左右,其余的s&p500,
s&p400,s&p300因为一直有变动,暂时还是不下手了。
NASDAQ
AMEX的股票list都弄下来,然后做一个所有的数据,后来发现中间的数据太多,要处理的小问题也太麻烦,所以现在尝试做的应该只限定在我以前在google
finance上建立的china的组合,大概在150个左右,其余的s&p500,
s&p400,s&p300因为一直有变动,暂时还是不下手了。
对于这个组合中的156个股票来说我希望的得到的东西是这些股票在过去3年中的历史成交价格和成交量以及一些其他的数据,从前几天网上搜到的一个matlab的程序中可以在yahoo
finance中可以得到这些数据,接下来的目标是要吧这些数据导入到一个数据库中去,因为按照那个程序,每回我得到的只是一个股票的历史价格,现在需要把这些价格都放到一个变量中去,这个变量就不免变得很大了,我对excel的数据处理能力没有信心,所以今天问了下小强,又什么办法自己建立一个数据库可以把这些数据都存进去。
对于这个想法也是现在才逐渐稳定下来,之前我想的一直是看有没有可能现在得到一个option的价格和成交量的表,这个现在看起来还是一个比较遥远的目标,虽然这些天我看了yahoo的网页编码和N人的matlab程序,对他的操作过程有了一些了解不过真的要把这个实现还不是现在就能做好的,换个角度说,即使我现在可以把这些数据存下来,我存在什么地方?database?我想还是先试着自己可以建立一个数据库的文件再看了。
所以对于以后的一个大致想法应该是这样的:
1:从yahoo!fiance中取下我要的这些历史数据(这中间就包括了,1如果实现那个下历史数据从一个股票到150个股票的修改,2存下来的数据怎么样导入到我的数据库,3怎么样做到数据库的自我更新。)
2:从yahoo上下这个股票的option数据(这中间的一些细节应该包括:1怎么样判断这些股票是不是有option,虽然很多股票有,但也有不少stock是没有option的,2,怎么自动或者这些股票的所有option数据,由于option设定的不同,股票之间的option到期应该是不一样的,这是前段时间在图书馆看到而且在IBM
YGE中得到证实的。现在的初步想法是用现在的month去做关键词往网页代码中搜索,如果出现,就按顺序把后面接着出现的几个month的值存到变量中,然后在一个选择的程序下对这些month进行页面扫描。3,如果之前的过程顺利的话,我应该可以得到一些option的值,接下来就是把这些值存到我之前建立的database中,不过这中间应该有些麻烦,我不确定我能做好,只能一步步试着做了,现在看起来最大的问题可能是我的电脑跑不起这么大的数据,难道因为这个要考虑换个电脑?有闲钱再看了。后话暂时不提。
YGE中得到证实的。现在的初步想法是用现在的month去做关键词往网页代码中搜索,如果出现,就按顺序把后面接着出现的几个month的值存到变量中,然后在一个选择的程序下对这些month进行页面扫描。3,如果之前的过程顺利的话,我应该可以得到一些option的值,接下来就是把这些值存到我之前建立的database中,不过这中间应该有些麻烦,我不确定我能做好,只能一步步试着做了,现在看起来最大的问题可能是我的电脑跑不起这么大的数据,难道因为这个要考虑换个电脑?有闲钱再看了。后话暂时不提。
3如果我顺利的完成了上面的两部分,我现在数据库中应该有股票的历史价格,当日价格和option的历史价格当日价格。接下来就是怎么样对这些数据分析了,现在的初步想法是找到一些成交量变化比较大而且可能出现一些股价变化的股票。
4如果上面的也能够成功,下面就是把option的那些策略套进去,比如cover
call之类的,利用所学的边界前沿和delta分析给自己建立一个资产组合。让后做一些统计学的分析,看这样的策略能不能保证我的收益。如果能做到这个部分的话,我应该开始考虑加入一些其他的工具,如果能做成模块的分析当然更好了,不过现在来看还是遥远了些
call之类的,利用所学的边界前沿和delta分析给自己建立一个资产组合。让后做一些统计学的分析,看这样的策略能不能保证我的收益。如果能做到这个部分的话,我应该开始考虑加入一些其他的工具,如果能做成模块的分析当然更好了,不过现在来看还是遥远了些
5最后尝试能不能往其他的方向扩展,如果真的能做到这个程度的话,这个计划基本上是成功了。
6建立一个网络版的服务器,把这个程序结果放上去。做一个可执行文件。exe的
7考虑用c++代替中间的matlab。
8,一个向app 和api模块的转化。
9建立一个开放的平台,提供接口和研究办法。这些都是很遥远的事情了。
anyway,我还是一步步来吧,希望这个学位结束的时候我能把这个东西做完一半吧,考虑太多是没有必要的,只要一步步的走下去百度
google,学习,这就是学习了。
google,学习,这就是学习了。
预祝能做下来吧。
Crews He
25/7/2009