XF Barbell中的XFka电路中代表什么意思思

 上传我的文档
 下载
 收藏
粉丝量:90
该文档贡献者很忙,什么也没留下。
 下载此文档
chapter 1 introduction discounted cash flow method:1章介绍了折现现金流方法
下载积分:2000
内容提示:chapter 1 introduction discounted cash flow method:1章介绍了折现现金流方法
文档格式:PPT|
浏览次数:1|
上传日期: 08:22:28|
文档星级:
全文阅读已结束,如果下载本文需要使用
 2000 积分
下载此文档
该用户还上传了这些文档
chapter 1 introduction discounted cash flow meth
关注微信公众号This is a review for the Super Power Bar, a high tensile strength, stainless steel power bar manufactured by American Barbell. Update: the AB Super Power Bar reviewed here no longer exists as a product. It has been replaced by the new , which is only similar to the Super in that it is an American Barbell powerlifting bar. I have left this review as is for anyone who is considering a used Super Power Bar, or those who are simply curious about the old Super. First I’d like to say that I hope a power bar will be a welcomed addition to the collection of bar reviews here at Garage Gyms. The bars that have typically gotten all the attention here have either been dual-marked, multi-purpose bars, or Olympic weightlifting bars. Since I am quite sure that there are just as many big-3 lifters in garage gyms as there are CrossFit and Oly lifters, and since I personally get much more joy out of the deadlift than I do the snatch, I figured that a power bar review is probably long overdue.
The Power Bar So what is the benefit of using a power bar when training heavy compound lifts rather than using a weightlifting bar or a multi- like say Ohio or California? Well there are a number of features exclusive to powerlifting bars that make them a superior choice when it comes to heavy deadlifts, squats, and presses, and they are as follows: For starters, a power bar needs to have a very firm, reliable grip that won’t slip when a lot of weight is involved. You can’t expect to pull a max-effort deadlift with a weak knurl, and most dual-purpose bars have a soft to medium knurl better suited for moderate weights and high reps. Most of these dual-marked bars also forego the center knurl, an important feature for heavy back squats. Secondly, a power bar needs to have sleeves that rotate, but not high speed sleeves that’ll spin erratically. This is not usually a problem with multi-purpose bars since they too tend to be bushing bars, but bearing bars are certainly less than ideal (and they cost more than you need to spend.) F and this is probably the most defining attr a power bar needs to have a shaft of sufficient strength and rigidity to not whip around during lifts. When you get four or five plus wheels on each sleeve, you want as little springiness in the bar as possible. Bar whip is for the clean and jerk, not the squat.
So to sum it up, we want good knurl and a center knurl, moderate but reliable spin, and no significant whip. These are some of the things I’ll be looking at with the Super Power Bar.
Super Power Bar Specifications Here are the specifications taken from the removed Super Power Bar product page. I have a couple comments about the product listing below.
20 kg men’s bar 28.5 mm shaft diameter Heat-treated stainless steel shaft Minimum 210,000 PSI tensile strength IPF hash marks Moderate knurl w/ 4″ passive center knurl L very rigid Machined steel sleeves with hard chrome finish High tensile strength composite bushing system Made in California, USA Lifetime warranty against anything but negligence Retail price of $595
The image on the AB website does not accurately display the unique coloration of the heat-treated shaft. I understand the desire to touch up images a website, but this is one of those bars where it might have been best to leave the images alone as the coloration is just sexy. Hopefully the images of my bar will do the bar some justice. You’ll get grey steel end-caps, not blue steel. Also, the Super does not come with the steel blue end caps as the image on the American Barbell site shows, but rather the gun metal color (below) just like the caps on the SS WOD or California Bar. I don’t know if the caps were changed at some point, or if the bar shown in the image is even the correct bar. Personally I like the blue more, but alas.
Stainless Steel Shaft I’ll talk about the actual feel and grip of the bar below, but for now I just wanted to point out an aesthetic feature of the bar that I think makes it really cool, and that is the coloration of the stainless steel shaft after being heat-treated. In the image below the top bar is the American Barbell SS WOD Bar. This is what standard stainless steel bars look like. Below that you can see the heat-treated Super Power Bar. The heat treatment gives the stainless a darker, almost purplish red shade that transitions in and out with the knurling. It’s really neat.
Since my garage does not get all that bright, I took the bar outside into the direct sunlight. The darkness of the knurled parts of the bar are obviously not quite so dark in the sun, but you can still see the transition from bright to dark. Very unique and pretty bar, and it’s even more so in person.
I realize this has nothing to do with the performance of the bar, but in an age when colored rubber bands wrap around sleeves and end caps keep getting more and more colorful and catchy, it’s silly not to think that a naturally beautiful and unique barbell shaft shouldn’t be mentioned or highlighted.
Sleeve Rotation/Assembly The Super Power Bar utilizes high tensile strength composite bushin presumably the same bushings that are found in all of American Barbell’s bushing bars. For Olympic training bars I find bronze to be a better choice, but I think that using composite in a power bar is the way to go. Composite has slightly less spin than sintered bronze does in my experience, and since power bars don’t need to have excessive spin it’s a great match.
Not only that, but composite bushings theoretically should outlive bronze bushings because of their high tensile strength and superior impact resistance, but since I can’t remember the last time I heard about a cracked bronze bushing, this factoid is of very little significance to me. I suppose one could argue that in a bar loaded for an 800-pound deadlift, the bushing could use all the extra strength it could get. In any case, the Super Power Bar offers more than enough spin for a power bar, but it isn’t excessive. It functions beautifully for the slow compound lifts, and spins well enough for a smooth turnover in the power clean. No complaints.
Whip The 210,000 PSI Super Power Bar stays pr as it should. It would be even stiffer if it were it a 29 mm bar, but what can you do. Even the Texas Power Bar is a 28.5 mm bar. Remember that you can’t eliminate flex as plate after plate gets loaded, but you can reduce the springiness, and that’s why power bars shoot for the thicker, high strength shafts.
Knurling/Grip
It may come as no surprise to you that I found the grip to be outstanding. As per usual, the refined, moderate knurl on a stainless steel shaft allowed me to effortlessly hold on to the bar during pulls without the need for excessive chalk or straps. Of course with this being my third stainless steel bar, I’m really not all that surprised by this. You just can’t beat the feel of a raw steel when it comes to barbells. If I had to rate the overall grip and feel of the bar, I’d give it a 9/10. It’s true that I’ve given both the other American Barbell stainless steel bars that I’ve reviewed a 10/10, but since this is a power bar I feel that the knurl could have been just slightly more aggressive, and that’s despite the fact that it doesn’t necessarily need to be. Powerlifters are likely to not only be used to a sharper knurl on their bars, but to also somewhat expect it. Still though, the grip is outstanding, and a score of 9 is many full digits higher than most bars I come in contact with. I’d give the thing a 10 if this was a bar for any other application, but no other form of weight training loads up bars with as much weight as powerlifting, and a good chunk of the worth of a power bar revolves around that knurl. One other thing about the knurl. Not the knurl depth, but rather the placement. The SPB has it’s outer knurl closer to the center knurl than most standard bars. I personally don’t mind this one bit, but some of you may and I wanted to point it out. In this picture from my , you can see from bottom, the Chan, then the B&R, followed by the Super Power Bar. Using the B&R as a example of “normal”, you can see how both the Super PB and the Chan are knurled differently.
Super Power Bar Review – Summary I really like this bar. I think the name leaves a lot to be desired, but the bar itself is bad ass. The stainless steel shaft fails to disappoint, and the coloration of shaft makes this bar about as unique as it could possibly be among the standard go-to power bars. The specifications are above average, the measurements all check out, and the hard chrome on the sleeves is actually hard chromium, and not something else entirely (like many manufacturers like to mislead us about.) This may shock some of my older readers, but my Chan Bar has been spending a bit more time in the gun rack ever since I picked up the Super. Even though both the Chan and the Super both have nearly perfect grips (despite accomplishing this differently), I’ve been liking the Super more since it not only feels more rigid but is also a much, much quieter bar. Even considering the custom knurl pattern of the Chan and how great it is for deads and cleans, I still find I’m preferring the Super Power Bar. Of course, this doesn’t make the Chan any less of a bar. The Super retails for a lot more cash, so it better outperform a multi-purpose bar in the heavy compound lifts. The only downside to the Super Power Bar is that price. I won’t argue that $595 for a power bar is a lot of money. Still, considering the alternatives in the stainless steel department, the price is definitely more than reasonable. Ivanko stainless steel bars will set you back well over a grand. Iron Wolfe bars are stainless steel as well, but expect to pay north of $800 for one of those, and they’re only single lift bars (deadlift bar, bench bar, squat bar.) I think it says a lot about American Barbell and their products that their bars make up two of my three favorite bars at the moment. If you’re in the market I suggest you .
Share this:
Next post:
Previous post:
Subscribe for new post notifications
Disclosure: Articles may contain affiliate links...
Recent Reviews
Send to Email Address
Your Email Address
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.&figure&&img src=&https://pic2.zhimg.com/v2-47ecd4df5eaf82f05cfdae_b.jpg& data-rawwidth=&1400& data-rawheight=&400& class=&origin_image zh-lightbox-thumb& width=&1400& data-original=&https://pic2.zhimg.com/v2-47ecd4df5eaf82f05cfdae_r.jpg&&&/figure&&p&本小矿的第一篇推送火热出炉啦!&/p&&p&本小矿希望借着这个平台和大家多多交流有关&strong&量化投资&/strong&的内容,以后会竭力为大家奉献更多的干货!&/p&&p&本小矿的小店新开张先扔个大个的顶在前面——经典文献翻译系列的第一篇,Barra于2005年发布的中国市场多因子风险模型CHE2&strong&《CHE2: Forecasting Chinese Equity Risk》&/strong&。本小矿为大家带来原文的全文翻译,希望能尽量做到把最原汁原味的文章呈献给大家,但毕竟水平有限,有翻译不周的地方还请大咖们多多指教。&/p&&p&由于原文较长,分多期为大家推送。另外想看英文原文的同学请戳-&链接:&a href=&http://link.zhihu.com/?target=http%3A//pan.baidu.com/s/1o82IiIQ& class=& external& target=&_blank& rel=&nofollow noreferrer&&&span class=&invisible&&http://&/span&&span class=&visible&&pan.baidu.com/s/1o82IiI&/span&&span class=&invisible&&Q&/span&&span class=&ellipsis&&&/span&&/a& 密码:0bqx&/p&&p&话不多说,各位看官请看。&/p&&p&-------------------------------------------------------------------------------------------------------------------&/p&&h2&&b&CHE2&/b&&b&:预测中国股票风险&/b&&/h2&&p&&b&摘要&/b&:CHE2模型用于预测中国大陆股票组合的风险,即由A股与B股组成的投资组合。模型利用日度数据,因此可以及时应对中国市场风格的快速变化。&br&&/p&&p&&b&一、引言&/b&&/p&&p&
中国的股票市场近年来发展非常迅速,因此,不论是个人投资者还是机构投资者都非常积极地投身其中,希望从中国经济增长红利中分得一杯羹。与其它新兴市场相似,伴随着潜在的巨大收益的自然是相匹配的市场风险,所以中国股票市场收益率的波动性非常之高。&/p&&p&
想要去找出中国股票市场风险的特征,并且量化它是很困难的。首先,市场风险水平不仅处于高位,而且波动相当大;其次,市场的监管理念不断更新,市场容量不断扩张,导致市场环境也不断地变化。几乎每年中国股票市场都会发行很多新股票,例如,2005年上海交易所和深圳交易所中共有大约1,400支股票,而在十年前,这个数字大概要缩水2/3。这种爆炸式的扩张方式正是我们总结市场规律和模式的难点所在,更不用说去对市场风险做出预测了。&/p&&p&
那么究竟有什么方法可以摆平这些难点呢?利用相对高频的数据可以算是解决方案之一,即对历史日度数据进行分析。日度数据提供的信息量大约是月度数据的20倍,足以使我们及时掌握市场变化的动态。&/p&&p&
因此,基于日度数据,MSCI
Barra公司开发出了一套新的中国股票市场的风险模型,叫做CHE2。CHE2的前一代产品叫做CHE1,CHE1中的数据频率是月度,相较于CHE2则无法更加快速、有效地对市场风格变化做出判断。&/p&&p&
除了上述数据频率的区别外,CHE2与CHE1所覆盖的股票池也有不同之处。如何去定义“中国股票市场”究竟包含哪些股票板块从来都是非常有争议的,关键点在于,香港的H股应不应该与中国大陆的A股和B股一起被划入中国股票市场。尽管有一些在中国内地运营的公司在香港上市(H股与红筹股),但是大多数大陆的公司还是在上海和深圳交易所上市。从建模的角度,对于这些运营与上市地点分别在内陆和香港的公司,还是很有必要对它们单独建立模型。因此,尽管CHE1把H股囊括在股票池中,CHE2的股票池还是仅限于A股与B股。&/p&&p&
本文下面将着眼于CHE2模型的建立,并将其与CHE1模型作出细致的对比。第二章将简略地介绍股票风险的因子模型,以确保后续章节中内容更易于读者接受。第三章将对CHE2的股票池作更细化的解析,同时描述了CHE2中用于预测的数据。CHE2模型的因子们揭示了股票间共通的特征,这些因子被分成两类:行业因子与风格因子。行业因子用于描述股票所处行业对风险的影响,第四章中将会阐述模型中行业分类的原理。风格因子用于描述股票间行业因素以外的共同风险因子的来源,第五章中将会阐述CHE2中风格因子的选取。第六章将阐明如何将日度因子收益用于风险预测。第七章的主题是特殊风险预测,特殊风险是风险中与共同风格因子无关的部分,随股票的不同而不同,而且是可以被分散的。第八章将展示模型的表现情况。第九章将指导CHE1模型的现使用者如何转变去使用CHE2。最后一章会对全文进行回顾和总结。&br&&/p&&p&&b&二、CHE2因子模型&/b&&/p&&p&&u&1.为什么需要建立因子模型?&/u&&/p&&p&
股票组合的风险取决于组合股票间的相关性。从数学上来说,如果组合的风险被定义为组合收益率的(年化)标准差&img src=&http://www.zhihu.com/equation?tex=%5Csigma+_p& alt=&\sigma _p& eeimg=&1&&,则股票收益率的协方差矩阵&img src=&http://www.zhihu.com/equation?tex=V& alt=&V& eeimg=&1&&包含了衡量风险的所有信息,即组合风险为:&br&&/p&&img src=&http://www.zhihu.com/equation?tex=%5Csigma+_p%5E2+%3D+w%5Et+Vw& alt=&\sigma _p^2 = w^t Vw& eeimg=&1&&&br&&p&其中&img src=&http://www.zhihu.com/equation?tex=w& alt=&w& eeimg=&1&&是股票权重的列向量。例如,如果组合持有第五支股票的总额占总组合的2%,则&img src=&http://www.zhihu.com/equation?tex=w_5%3D0.02& alt=&w_5=0.02& eeimg=&1&&。如果组合中没有某只股票,那么这支股票对应的权重则为零。&/p&&p&
预测股票组合风险的一个非常困难的问题是:股票间相关关系需要非常大量的数才可以被完整描述。假如市场中已经发行了&img src=&http://www.zhihu.com/equation?tex=N& alt=&N& eeimg=&1&&支股票,那么这个市场所有股票的协方差矩阵&img src=&http://www.zhihu.com/equation?tex=V& alt=&V& eeimg=&1&&就是一个&img src=&http://www.zhihu.com/equation?tex=N%5Ctimes+N& alt=&N\times N& eeimg=&1&&的对称矩阵。比如在一个有1,000支股票的市场中,想要预测风险就必须同时预测任意两只股票间的相关性,也就是说大概需要预测五百万个数。再进一步,如果想基于日度历史数据来做预测,那么这个风险模型必须至少有这1,000支股票的超过500个交易日的数据才可以。事实上,如果希望做出较为准确的预测,那么最好用超过10年的数据,但是在多变的中国股票市场中,这显然是不可行的。所以,如果希望得到良好的预测效果,如何更加有效的利用数据是关键。&/p&&p&
另一方面,且不说数据是不是可以被有效利用,对数据不加判断就强行使用是更加危险的事情。意外事故很容易曲解原始的历史风险,例如,如果过去某时刻,在一家公司报告了良好的业绩的同时,另一家公司恰好遭遇丑闻,这一时间上的巧合会使我们在后来分析历史数据时发现两家公司的股票是可以对冲的,但事实却是这仅仅是历史的巧合而已。&br&&/p&&p&&u&2.因子模型&/u&&/p&&p&
通过一些相对数量较少的共同因子来分解收益率,因子模型都可以很好地解决对于上节所说的两点,即如何有效利用数据和如何有效减少历史事故的影响。因子的收益率&img src=&http://www.zhihu.com/equation?tex=f& alt=&f& eeimg=&1&&,通过风险暴露&img src=&http://www.zhihu.com/equation?tex=X& alt=&X& eeimg=&1&&与个股收益率关联。因子模型通过下面方程的形式将股票收益率分解:&/p&&img src=&http://www.zhihu.com/equation?tex=r%3DXf%2Bu& alt=&r=Xf+u& eeimg=&1&&&br&&p&这个方程将&img src=&http://www.zhihu.com/equation?tex=N%5Ctimes+1& alt=&N\times 1& eeimg=&1&&的收益率列向量r分解为两个部分:一是共同因子部分&img src=&http://www.zhihu.com/equation?tex=Xf& alt=&Xf& eeimg=&1&&,它是&i&N×M&/i&的风险暴露矩阵与&img src=&http://www.zhihu.com/equation?tex=M%5Ctimes+1& alt=&M\times 1& eeimg=&1&&的因子收益率列向量的乘积,二是特殊收益部分&img src=&http://www.zhihu.com/equation?tex=u& alt=&u& eeimg=&1&&。在理想情况下,如果因子模型表现优秀的话,那么一只股票的特殊收益将会与其它股票的特殊收益在统计上独立,因此组合的总体特殊风险可以会被分散化,增加组合的股票数量可以降低特殊风险。同时要通过控制组合中个股因子的风险暴露来对冲因子风险。&/p&&p&
因子模型对风险的预测为:&/p&&img src=&http://www.zhihu.com/equation?tex=%5Csigma+_p%5E2+%3D+w%5EtVw+%3D+w%5EtXFX%5Etw%2Bw%5Et%5CDelta+w& alt=&\sigma _p^2 = w^tVw = w^tXFX^tw+w^t\Delta w& eeimg=&1&&&br&&p&上式中将组合的协方差矩阵&img src=&http://www.zhihu.com/equation?tex=V& alt=&V& eeimg=&1&&重新分解为共同因子风险和特殊风险两个部分,其中共同因子风险包含共同因子收益率协方差矩阵的预测值&img src=&http://www.zhihu.com/equation?tex=F& alt=&F& eeimg=&1&&,特殊风险包含特殊收益率协方差矩阵的预测值&img src=&http://www.zhihu.com/equation?tex=%5CDelta+& alt=&\Delta & eeimg=&1&&。&img src=&http://www.zhihu.com/equation?tex=F& alt=&F& eeimg=&1&&是&img src=&http://www.zhihu.com/equation?tex=M%5Ctimes+M& alt=&M\times M& eeimg=&1&&的矩阵,体积相比于所有股票的协方差矩阵&img src=&http://www.zhihu.com/equation?tex=V& alt=&V& eeimg=&1&&来说小了很多,而&img src=&http://www.zhihu.com/equation?tex=%5CDelta+& alt=&\Delta & eeimg=&1&&则是对角矩阵(如果我们忽略同一公司发行的不同股票间的关系的话),只&i&有&/i&&img src=&http://www.zhihu.com/equation?tex=N& alt=&N& eeimg=&1&&个非零项需要估计。因此,整体而言,需要预测估计变量的数目在因子模型中急剧减少,可以很有效地评估横截面上股票间的相关性。&/p&&p&&u&3.风险模型的因子&/u&&/p&&p&
在市场中,相似的股票有一些共通的特征,以致于经常会有相似的收益率,模型中的因子们正体现了这些特征,其中一个最基本的特征就是行业。比如说,相比于其它行业股票来说,一个IT公司的股票肯定要与同行的股票更相似,从而有更接近的收益率。反映在模型中,我们可以给所有的IT公司股票赋予一个IT行业因子的暴露&img src=&http://www.zhihu.com/equation?tex=X_%7BIT%7D%3D1& alt=&X_{IT}=1& eeimg=&1&&,其它行业的股票则有&img src=&http://www.zhihu.com/equation?tex=X_%7BIT%7D%3D0& alt=&X_{IT}=0& eeimg=&1&&,但其所在行业的行业因子暴露为1。在因子协方差矩阵F中会体现行业与行业之间的关系。&/p&&p&
类似的,例如估值(如PB或PE)或者规模(如股票市值或总资产)这些特征也可以作为股票相似性的划分条件。与行业因子不同的是,这些因子被称为风险因子。&br&&/p&&p&&u&4.因子回归&/u&&/p&&p&
为了估计因子协方差矩阵F,因子的历史收益率是必须的,从历史值中我们可以得到因子间的统计关系。方法则是用历史上股票的收益率对各因子作多元回归。&/p&&p&
用于回归的一篮子股票叫作估计股票池。在CHE2模型中,估计股票池由所有A股的股票组成,并剔除上市不满一个月的股票和最近12个月中“被ST”的股票。历史上CHE2模型的估计股票如表1所示:&/p&&p&表1&/p&&figure&&img src=&https://pic3.zhimg.com/v2-a30ac1c229baaf885daec187e9c0926a_b.png& data-rawwidth=&554& data-rawheight=&303& class=&origin_image zh-lightbox-thumb& width=&554& data-original=&https://pic3.zhimg.com/v2-a30ac1c229baaf885daec187e9c0926a_r.jpg&&&/figure&&p&
因子的回归可以找出对股票收益率解释力最强的因子,从数学上说,即选出最小比加权平均误差最小的因子:&/p&&img src=&http://www.zhihu.com/equation?tex=WSSR+%3D+%5Csum_%7Bj%7D%7B%5Crho+_j%5Cleft%28+r_j+-++%5Csum_%7BK%7D%7BX_%7Bjk%7Df_k%7D%5Cright%29%5E2+%7D+& alt=&WSSR = \sum_{j}{\rho _j\left( r_j -
\sum_{K}{X_{jk}f_k}\right)^2 } & eeimg=&1&&&br&&p&此式对所有股票遍历求和。回归中的权重&img src=&http://www.zhihu.com/equation?tex=%5Crho+_j& alt=&\rho _j& eeimg=&1&&股票流通市值的平方根,这样可以保证体量越大的公司对因子模型的影响越大,也可以保证因子收益率不被几只市值非常之高的股票的特殊收益所过分影响。&/p&&p&
在这里对“市值”一词作出特别注释:在本文中,名词“市值”总是指上市公司总市值中可交易的部分,即流通市值。原因是国有上市企业的大部分股权由政府所有,使得我们很难分析公司整体。&/p&&p&&u&5.稀疏行业修正&/u&&/p&&p&
尽管在上一节中,我们用流通市值平方根加权的方法作回归,但在一些股票数量较少的行业中,如此处理权重还是不甚理想。换句话说,在一个行业中,对因子收益率有贡献的有效股票数量可能非常少。在这里,我们用简单的贝叶斯先验方法来进行稀疏行业的修正。&/p&&p&
在CHE2中,在有需要的情况下,应该进行稀疏行业修正。我们设一个行业中的“有效”上市公司数量为&/p&&img src=&http://www.zhihu.com/equation?tex=n_i+%3D+%5Cfrac%7BW_i%5E2%7D%7B%5Csum_%7Bj%5Cin+i%7D+%5Crho+_j%5E2%7D+& alt=&n_i = \frac{W_i^2}{\sum_{j\in i} \rho _j^2} & eeimg=&1&&&br&&p&上式是对行业内的所有上市公司求和。其中&/p&&img src=&http://www.zhihu.com/equation?tex=W_i+%5Cequiv+%5Csum_%7Bj%5Cin+i%7D+%5Crho+_j& alt=&W_i \equiv \sum_{j\in i} \rho _j& eeimg=&1&&&p&是行业中所有股票回归权重之和。如果一个行业包含的股票数量小于5,那么应在行业中加一个代理股票,它的收益率与市场基准的收益率相同,权重为&/p&&img src=&http://www.zhihu.com/equation?tex=%285-n_i%29%5Cfrac%7BW_i%7D%7Bn_i%7D+& alt=&(5-n_i)\frac{W_i}{n_i} & eeimg=&1&&&br&&p&此代理股票没有非零风险因子暴露。在一个行业还没有一只股票的时候,这个行业的因子收益率则与市场收益率一致。这样一来稀疏行业修正达成了减少特定股票对行业因子收益率的影响的目的。&/p&&p&&u&6.B股与B股次级回归&/u&&/p&&p&
CHE2模型的估计股票池只包含A股,因此还没有为B股的两个风险因子建立模型。这两个B股的风险因子分别为BUNIV和BSZSE,其中BUNIV用于区别股票是B股还是A股,BSZSE用于区别股票是否是深圳交易所的B股,这两个因子的估计模型为次级回归。首先,&/p&&p&
其它模型的股票的收益率减去其因子收益率生成残差项,A股模型的残差项即为特殊收益率。而B股模型则是在首级回归完成后,再以残差项作为因变量进行第二次回归,权重与首级回归相同。B股的次级回归的估计股票池由所有B股组成,但也要删去上市不足一月的新股和近12月内“被ST”的股票。残差项对BUNIV和BSZSE回归后的残差项即为B股的特殊收益率。&/p&&p&(待续)&/p&&p&-------------------------------------------------------------------------------------------------------------------&br&&/p&&p&第一部分就到这里啦,后面会逐渐给大家更全的。&/p&&p&最后给自己的公共号打个小广告:面包矿工。求各位大咖们的一波关注!&/p&&figure&&img src=&https://pic4.zhimg.com/v2-f8acbf3214ebccf08031b_b.jpeg& data-rawwidth=&430& data-rawheight=&430& class=&origin_image zh-lightbox-thumb& width=&430& data-original=&https://pic4.zhimg.com/v2-f8acbf3214ebccf08031b_r.jpg&&&/figure&
本小矿的第一篇推送火热出炉啦!本小矿希望借着这个平台和大家多多交流有关量化投资的内容,以后会竭力为大家奉献更多的干货!本小矿的小店新开张先扔个大个的顶在前面——经典文献翻译系列的第一篇,Barra于2005年发布的中国市场多因子风险模型CHE2《CHE2:…
&figure&&img src=&https://pic4.zhimg.com/v2-7cad48e4c8a42d1b15b8af_b.jpg& data-rawwidth=&400& data-rawheight=&300& class=&content_image& width=&400&&&/figure&&p&前一段时间,李腾、陈烨、邓岳、陈志岗几位老师在知乎上发布了一份多因子模型的测试题,其中囊括了多因子建模过程中大部分需要考虑的理论和实践问题:&/p&&p&&a href=&http://zhuanlan.zhihu.com/p/& class=&internal&&多因子模型水平测试题 - 科学投资 - 知乎专栏&/a&&/p&&p&在过去几个月时间,米筐科技(RiceQuant)量化策略团队对这套经久不衰的量化模型进行了系统研究。由于我们一贯追求完美的工匠精神,相关的产品项目好像还需要一段时间才能发布。。。可这又有什么关系呢?毕竟等待过的东西才是最好的——如美酒,如家书,如高中教室窗外的顾盼倩影。&/p&&p&在数日前,我对测试题的因子部分进行了试答:&br&&/p&&p&&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&多因子模型水平测试题试答(因子部分) - 机器学习 & 金融量化分析 - 知乎专栏&/a&&br&&/p&&p&下面,我继续对风险预测部分分享一些自己的想法。&/p&&p&本期嘉宾:流川枫。&/p&&br&&br&&p&*************** 多因子模型测试题回答开始 ***************&/p&&p&&b&&i&1 用于风险预测的多因子模型,在拟合时应侧重考虑哪些方面?&/i&&/b&&/p&&p&&b&答:&/b&这里假定题目中所说的&b& “&/b&拟合” 是 Barra 的结构化风险模型的回归系数估计步骤,那么:&/p&&p&1 仔细检查离群值,剔除错误或不合理的离群值,把合理的,但在三个标准差以外的离群值拉回到三个标准差;&br&&/p&&p&2 用市值平方根近似股票的特异波动率,对股票进行加权。一方面减轻残差异方差性的影响,另一方面保证在所有风险暴露相同的组合之中,因子组合是风险最小的组合 。&/p&&p&详细可见 Barra 发布的 USE4 (The Barra US Equity Model)或 CNE5(Barra China Equity Model)研究报告。 &/p&&br&&br&&p&&i&&b&2 是否有必要预测收益的波动率?如何预测收益的波动率?是否要在优化中使用波动率?&/b&&/i&&br&&/p&&br&&b&答:&/b&第一个和第三个就不说了,回答第二个问题。&br&&br&在使用多因子模型对资产风险进行预测时,我们一般使用 Barr Rosenberg (Barra创始人)1974 年提出的建模思路,先估计因子收益的协方差矩阵,再预测组合收益的协方差矩阵。&br&&br&如果直接对资产组合收益的波动率建模,由于多期的资产收益波动率通常是一个自相关性不稳定的非平稳时间序列,使用多因子模型进行时间序列回归的话,残差时间序列也可能是非平稳的。因此会造成以下问题:&br&&br&1 最小二乘法不再是最优线性无偏估计(Best Linear Unbiased Estimation,BLUE),需要采用广义最小二乘法(Generalized
Least Square, GLS)进行回归系数估计;&br&&br&2 残差自相关性导致一些基于残差分析的绩效指标和统计量(信息率和T统计量)不再适用。&br&&br&因此,如果希望对资产组合的波动率直接进行预测,一般会使用 Garch 模型等时间序列模型。&p&在 &i&MSCI Barra&/i& 的研究报告 &i&&Predicting Risk at Short Horizons& &/i&里面,详细比较过几种预测投资组合波动率的方法,结果显示 USE4 中的方法效果较好。&/p&&p&&br&&br&&i&&b&3 多因子模型预测出的协方差矩阵是否会有发生高度接近奇异的情况?&/b&&/i&&br&&br&&b&答:&/b&有可能。如果因子收益的协方差矩阵是奇异矩阵(一个可能的原因是用于估计的因子收益时间序列较短),则估计出来的资产收益协方差矩阵也可能是奇异的。可以通过采用以下方式进行处理:&/p&&p&(1)增加因子收益的时间序列长度;&/p&&p&(2)采用 USE4 中的 eigenfactor risk adjustment;&/p&&p&(3)使用矩阵收缩(matrix shrinkage)对因子协方差矩阵进行降噪。&br&&/p&&p&&br&&b&&i&4 设我们称风险预测模型中的因子为“风险因子”,称收益预测模型中的因子为“alpha因子”。如果一个alpha因子也入选了风险因子,会对组合优化结果产生什么影响?如果在风险模型中特意剔除所有alpha因子,会对组合优化结果产生什么影响?&/i&&/b&&br&&br&&b&答:&/b&如果一个 alpha 因子进入了风险结构化模型,且在组合优化时对其进行了中性化处理,那么该 alpha 因子理论上不会产生收益。&/p&&p&组合优化中,哪些因子是阿尔法因子,哪些是风险因子,取决于测试结果和投资者本身对于该因子的理解。就一般而言,对越多因子进行中性化处理,资产组合的风险就越低,同时预期收益也会越低;反之风险和预期收益都会增加。&/p&&p&&br&&i&&b&5 BARRA的多因子风险预测模型主要在哪些细节上做了精细处理?&/b&&/i&&br&&br&&b&答:&/b&我已经把 USE4 和 CNE5 背下来了。没有任何细节再让我感觉到精细了。&/p&&p&&br&&b&&i&6 BARRA在不同市场上的多因子风险预测模型之间的细微差异,反映了各个市场的哪些特点?&/i&&/b&&br&&br&答:对比 USE4 和 CNE5 的话,USE4 中的因子组比 CNE5 多出了两个:Dividend Yield 和Non-Linear Beta。&/p&&p&对于 Barra 的因子取舍问题,我也存有疑问。从直觉而言,Dividend Yield 在美国市场的的影响力大于中国市场是可以理解的。但从 USE4 给出的统计检验结果来看,Dividend Yield 在美国市场的显著性并不高(T统计量绝对值的均值为 1.37),在所有因子中排名倒数第二。因此在效果不佳的前提下,为什么在 USE4 保留而 在CNE5 中舍弃呢?我个人推测如下:&/p&&p&1 CNE5 的模型(2012年发布)比 USE4的模型 (2011年发布)更为领先,Barra 发现该因子在中国市场效果同样不佳,予以舍弃;&/p&&p&2 Dividend Yield 在美国长期使用,为了保证模型作为商业化产品的稳定性,没有放弃该因子,而在中国市场没有类似的顾虑;&/p&&p&3 美国的投资者非常关注组合对于 Dividend Yield 的暴露情况,因此作为后面中性化处理的重要维度予以保留,而中国的投资者并不太关心组合对于Dividend Yield 的暴露情况。&/p&&br&&p&Non-Linear Beta 因子是一个数学或者物理意义上设计非常精巧的因子。第一次看到该因子的构建方式时,我有一种 “哇,好漂亮的思路!”的感觉。但我一直不能理解这个因子对应的投资逻辑。&/p&&p&依据这个因子的数学形式和 Barra 的解释,该因子对应一个 “barbell portfolio”,其思路是做空高贝塔值股票和低贝塔值股票,同时做多贝塔值处于中间的股票。也就是说,其投资思路是贝塔值高和贝塔值低的股票有类似的走势,而贝塔值处于中间的股票有相反的走势。&/p&&p&高贝塔值意味着该股票和市场整体走势大致相同,而低贝塔值意味着该股票和市场走势相关性不大,这两类型股票走势相近的合理解释是什么?我其实也不能理解。&/p&&br&&br&&p&&b&&i&7 用日数据vs用月数据估计协方差矩阵,各适用于什么需求?用日内(例如分钟级)数据来估计协方差阵的好处与坏处是什么?&/i&&/b&&br&&br&&b&答:&/b&由于这是一套多因子模型的测试题,因此问题的语境应该限定为 “用多因子模型进行风险预测” ,而不应该是讨论其它协方差矩阵的估计方法(例如单因素模型或者历史协方差矩阵)。如果使用分钟级别的数据,所选的因子必须有一致的时间尺度——这意味不能使用任何基本面因子,而只能使用量价因子。用一套量价因子来做收益预测是完全可行的,但我个人认为,仅仅使用量价因子做风险分解和预测未必妥当。&/p&&p&下面我们仅仅比较月频率和日频率的数据使用:&br&&/p&&p&理论上,Barra 的结构化模型中,相当部分的风险因子都是基本面因子,其时间尺度较大,因此每月计算一次因子收益即可。&br&&/p&&p&但在对因子收益的经验协方差矩阵(empirical covariance matrix)进行估计时,我们会面临以下的两难问题:&/p&&p&1 假定我们的模型中包含20个因子,那么我们至少需要 21 个月的数据。而对于政策变化频繁,投资理念不成熟的中国A股市场,21个月的时间已经足够让市场发生结构性的变化,从而使协方差矩阵的估计失去意义;&/p&&p&2 如果用日频率的因子收益计算,则其中包含的噪音相对较多,而且在得到日频率的因子收益协方差矩阵以后,我们对其进行时间尺度的转换,而且需要对其噪音进行严格控制。&/p&&br&&br&&p&&i&&b&8 怎样衡量或评估风险预测模型的有效性?&/b&&/i&&br&&br&&b&答:&/b&对于因子的有效性,USE 4 主要提到以下标准:&/p&&p&1 选用的因子组应该能够有效把系统性风险分解出来——即特异收益率没有相关性。特异收益率没有相关性也是结构化风险模型的假设之一;&/p&&p&2 在有效分解系统性风险的前提下,因子数目越少越好(parsimony),降低模型过拟合的可能性;&/p&&p&3 持续的统计显著性。对于具体某个因子,我们可以通过多期回归得到一组因子T统计量,如果这组T统计量的绝对值的均值大于2,或者在该组T统计量中,其绝对值大于2的比例较高,则认为该因子有很好的效果;&/p&&p&4 因子暴露度的稳定性。理论上,结构化风险模型更新频率是每月一次,因此因子暴露度时间尺度应该与之一致;&/p&&p&5 因子的共线性。因子之间存在共线性会导致回归系数的估计方差变大,因此在因子选择时应尽量避免出现共线性问题。&/p&&p&6 因子的经济学意义符合直觉。因子意义容易理解,一方面是模型质量的要求;另一方面,在组合优化的时候,我们需要根据自己的理解选择中性化约束。如果因子的意义难于理解,是否有必要对其进行中性化处理自然也无从判断。&/p&&p&除此以外,USE4中,也给出了因子的年化收益率、年化波动率、年化夏普率等指标。但我个人认为,如果以风险预测为目标,这些指标并不是必要的。&/p&&p&对于整个模型的有效性检验,USE4 提到以下标准:&/p&&p&1 可决系数(coefficient of determination),也就是我们常说的 R^2;&/p&&p&2 Bias Statistics ,这个测试的思路和我们开发策略常用的信息系数类似,是比较模型的预测和实际情况的差距;而基于 Bias Statistics 的 Mean Rolling Absolute Deviation(MRAD)会提供更多关于模型精度的信息。&/p&&br&&br&&p&&b&9 &i&本专栏上一篇文章封面里面,柯南和灰原哀一起困觉时说了什么?!&/i&&/b&&/p&&p&&b&答:&/b&对话如下:&br&&br&柯南:问你一件事情。&br&&br&灰原:。。。什么?(脸红)&br&&br&柯南:白天我脸上黏了饭粒吗?&br&&br&灰原:哈啊?(白眼)&br&&br&&br&*************** 多因子模型测试题回答结束 ***************&/p&&p&&br&&i&(背景:湘北对阵丰玉,南烈发现完全无法防住流川枫,对其恶意犯规,撞伤他的眼睛,试图阻吓他。)&/i&&/p&&p&&br&&i&你认为日本第一的球员会是怎样的球员?&/i&&br&&br&&br&&i&我认为他一定会带领球队成为日本第一。&/i&&br&&br&&br&&i&我想成为这种球员,&/i&&br&&br&&br&&i&所以我一步也不会退让的。&/i&&br&&figure&&img src=&https://pic3.zhimg.com/v2-c38b704e85be95fb96b1a27bb05b8d3c_b.jpg& data-rawwidth=&768& data-rawheight=&1024& class=&origin_image zh-lightbox-thumb& width=&768& data-original=&https://pic3.zhimg.com/v2-c38b704e85be95fb96b1a27bb05b8d3c_r.jpg&&&/figure&&figure&&img src=&https://pic4.zhimg.com/v2-ce95d428779edaa91dfee5c735bf1ab6_b.jpg& data-rawwidth=&768& data-rawheight=&1024& class=&origin_image zh-lightbox-thumb& width=&768& data-original=&https://pic4.zhimg.com/v2-ce95d428779edaa91dfee5c735bf1ab6_r.jpg&&&/figure&&/p&
前一段时间,李腾、陈烨、邓岳、陈志岗几位老师在知乎上发布了一份多因子模型的测试题,其中囊括了多因子建模过程中大部分需要考虑的理论和实践问题:在过去几个月时间,米筐科技(RiceQuant)量化策略团队对这…
&figure&&img src=&https://pic1.zhimg.com/v2-6e2b1bdb5a3f2df04b58cfc96d4c0c1c_b.jpg& data-rawwidth=&510& data-rawheight=&340& class=&origin_image zh-lightbox-thumb& width=&510& data-original=&https://pic1.zhimg.com/v2-6e2b1bdb5a3f2df04b58cfc96d4c0c1c_r.jpg&&&/figure&&p&Python模拟登陆让不少人伤透脑筋,今天奉上一种万能登陆方法。你无须精通HTML,甚至也无须精通Python,但却能让你成功的进行模拟登陆。&b&本文讲的是登陆所有网站的一种方法,并不局限于微博与知乎,仅用其作为例子来讲解。&/b&&/p&&p&用到的库有“&b&selenium”和“requests”&/b&。通过selenium进行模拟登陆,然后将Cookies传入requests,最终用requests进行网站的抓取。优点就是不但规避了“selenium”其本身抓取速度慢的问题(因为仅仅用其作为登陆),又规避了利用requests登陆时需要制作繁琐的Cookies的过程(因为是从selenium直接拿来cookies)。文章前面列出了步骤与代码,后面补充了登陆微博与知乎的实例。&/p&&p&&b&文章最后给出了一个懒人的方法。想要走捷径的朋友直接看第四部知乎登陆。该方法适用于登陆所有网站,仅用知乎作为实例以方便讲解。&/b&&/p&&p&------------开始---------&/p&&p&需要材料:1.自己喜欢的webdriver (必须) 2.Anaconda(可选)。selenium是借助浏览器而运行的,因此需要额外下载一款小型浏览器。Anaconda推荐大家也去下载一个,它里面包含了众多python的库,用起来很方便,而且免费!&b&友情链接&/b&:1.&a href=&http://link.zhihu.com/?target=https%3A//chromedriver.storage.googleapis.com/index.html%3Fpath%3D2.31/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&谷歌 Web Driver下载&/a& 2. &a href=&http://link.zhihu.com/?target=https%3A//www.anaconda.com/download/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Anaconda下载&/a&&/p&&h2&&b&第一部:利用selenium登陆&/b&&/h2&&p&导入selenium库&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&from selenium import webdriver
&/code&&/pre&&/div&&p&明确模拟浏览器在电脑中存放的位置,比如我存在了D盘&/p&&div class=&highlight&&&pre&&code class=&language-python3&&&span&&/span&&span class=&n&&chromePath&/span& &span class=&o&&=&/span& &span class=&s1&&r'D:\Python Program\chromedriver.exe'&/span&
&/code&&/pre&&/div&&p&用selenium的webdriver方程指明浏览器的路径,同时打开一个浏览器。模拟浏览器有多种可选,比如Firefox, Safari。本次用的是谷歌的模拟浏览器。注意:'.Chome'是大写字母。&/p&&div class=&highlight&&&pre&&code class=&language-python3&&&span&&/span&&span class=&n&&wd&/span& &span class=&o&&=&/span& &span class=&n&&webdriver&/span&&span class=&o&&.&/span&&span class=&n&&Chrome&/span&&span class=&p&&(&/span&&span class=&n&&executable_path&/span&&span class=&o&&=&/span& &span class=&n&&chromePath&/span&&span class=&p&&)&/span&
&/code&&/pre&&/div&&p&让webdriver为你填写用户名和密码&/p&&div class=&highlight&&&pre&&code class=&language-python3&&&span&&/span&&span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&find_element_by_xpath&/span&&span class=&p&&(&/span&&span class=&s1&&'用户名选项卡位置'&/span&&span class=&p&&)&/span&&span class=&o&&.&/span&&span class=&n&&send_keys&/span&&span class=&p&&(&/span&&span class=&s1&&'用户名'&/span&&span class=&p&&)&/span&
&span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&find_element_by_xpath&/span&&span class=&p&&(&/span&&span class=&s1&&'密码选项卡位置'&/span&&span class=&p&&)&/span&&span class=&o&&.&/span&&span class=&n&&send_keys&/span&&span class=&p&&(&/span&&span class=&s1&&'密码'&/span&&span class=&p&&)&/span&
&/code&&/pre&&/div&&p&让webdrive点击登陆,若是按钮就选择用click(),若是表单就选择submit()。&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&wd.find_element_by_xpath('登陆按钮所在位置').click() #若是按钮
wd.find_element_by_xpath('登陆按钮所在位置').submit() #若是表单
&/code&&/pre&&/div&&p&登陆完成,所有的cookies现在都存在了'wd'里面,可随时调用。&/p&&h2&&b&第二部:将selenium的cookies传入requests&/b&&/h2&&p&导入requests库,并构建Session()&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&import reqeusts
req = requests.Session()
&/code&&/pre&&/div&&p&从‘wd'里调出cookies&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&cookies = wd.get_cookies()
&/code&&/pre&&/div&&p&将selenium形式的cookies转换为requests可用的cookies。&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&for cookie in cookies:
req.cookies.set(cookie['name'],cookie['value'])
&/code&&/pre&&/div&&p&大功告成!尝试用requests来抓取网页。&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&req.get('待测试的链接')
&/code&&/pre&&/div&&p&&b&以上就是python模拟登陆的万能方法,你无需分析传递给网站的Cookies。只需要告诉python在什么地方填写用户名与密码就可以。十分的便利。&/b&&/p&&h2&&b&第三部:微博模拟登陆&/b&&/h2&&div class=&highlight&&&pre&&code class=&language-python3&&&span&&/span&&span class=&kn&&import&/span& &span class=&nn&&requests&/span&
&span class=&kn&&from&/span& &span class=&nn&&selenium&/span& &span class=&k&&import&/span& &span class=&n&&webdriver&/span&
&span class=&n&&chromePath&/span& &span class=&o&&=&/span& &span class=&s1&&r'浏览器存放位置'&/span&
&span class=&n&&wd&/span& &span class=&o&&=&/span& &span class=&n&&webdriver&/span&&span class=&o&&.&/span&&span class=&n&&Chrome&/span&&span class=&p&&(&/span&&span class=&n&&executable_path&/span&&span class=&o&&=&/span& &span class=&n&&chromePath&/span&&span class=&p&&)&/span& &span class=&c1&&#构建浏览器&/span&
&span class=&n&&loginUrl&/span& &span class=&o&&=&/span& &span class=&s1&&'http://www.weibo.com/login.php'&/span&
&span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&get&/span&&span class=&p&&(&/span&&span class=&n&&loginUrl&/span&&span class=&p&&)&/span& &span class=&c1&&#进入登陆界面&/span&
&span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&find_element_by_xpath&/span&&span class=&p&&(&/span&&span class=&s1&&'//*[@id=&loginname&]'&/span&&span class=&p&&)&/span&&span class=&o&&.&/span&&span class=&n&&send_keys&/span&&span class=&p&&(&/span&&span class=&s1&&'userword'&/span&&span class=&p&&)&/span& &span class=&c1&&#输入用户名&/span&
&span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&find_element_by_xpath&/span&&span class=&p&&(&/span&&span class=&s1&&'//*[@id=&pl_login_form&]/div/div[3]/div[2]/div/input'&/span&&span class=&p&&)&/span&&span class=&o&&.&/span&&span class=&n&&send_keys&/span&&span class=&p&&(&/span&&span class=&s1&&'password'&/span&&span class=&p&&)&/span& &span class=&c1&&#输入密码&/span&
&span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&find_element_by_xpath&/span&&span class=&p&&(&/span&&span class=&s1&&'//*[@id=&pl_login_form&]/div/div[3]/div[6]/a'&/span&&span class=&p&&)&/span&&span class=&o&&.&/span&&span class=&n&&click&/span&&span class=&p&&()&/span& &span class=&c1&&#点击登陆&/span&
&span class=&n&&req&/span& &span class=&o&&=&/span& &span class=&n&&requests&/span&&span class=&o&&.&/span&&span class=&n&&Session&/span&&span class=&p&&()&/span& &span class=&c1&&#构建Session&/span&
&span class=&n&&cookies&/span& &span class=&o&&=&/span& &span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&get_cookies&/span&&span class=&p&&()&/span& &span class=&c1&&#导出cookie&/span&
&span class=&k&&for&/span& &span class=&n&&cookie&/span& &span class=&ow&&in&/span& &span class=&n&&cookies&/span&&span class=&p&&:&/span&
&span class=&n&&req&/span&&span class=&o&&.&/span&&span class=&n&&cookies&/span&&span class=&o&&.&/span&&span class=&n&&set&/span&&span class=&p&&(&/span&&span class=&n&&cookie&/span&&span class=&p&&[&/span&&span class=&s1&&'name'&/span&&span class=&p&&],&/span&&span class=&n&&cookie&/span&&span class=&p&&[&/span&&span class=&s1&&'value'&/span&&span class=&p&&])&/span& &span class=&c1&&#转换cookies&/span&
&span class=&n&&test&/span& &span class=&o&&=&/span& &span class=&n&&req&/span&&span class=&o&&.&/span&&span class=&n&&get&/span&&span class=&p&&(&/span&&span class=&s1&&'待测试的链接'&/span&&span class=&p&&)&/span&
&/code&&/pre&&/div&&p&解释下关键的几个步骤:&/p&&p&1.找位置。推荐使用谷歌浏览器来查找每个元素的Xpath,参看这个:&a href=&http://link.zhihu.com/?target=http%3A//blog.csdn.net/li6727975/article/details/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&从Chrome获取XPATH路径&/a&。&/p&&p&2. 选择click函数还是submit函数。推荐每个都试一下,总会有一个成功的。&/p&&p&3.登陆微博是被要求输入验证码怎么办?有时登陆微博会被要求输入验证码,这个时候我们可以加一行手动输入验证码的代码。例如:&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&wd.find_element_by_xpath('//*[@id=&pl_login_form&]/div/div[3]/div[6]/a').click() #点击登陆
wd.find_element_by_xpath('//*[@id=&pl_login_form&]/div/div[3]/div[3]/div/input').send_keys(input(&输入验证码: &))
wd.find_element_by_xpath('//*[@id=&pl_login_form&]/div/div[3]/div[6]/a').click()#再次点击登陆
&/code&&/pre&&/div&&p&输入验证码的时候需要点击两次登陆。因为验证码的输入框只有在点击了一次登陆后才会弹出来!&b&根据每个网站的不同而灵活应用selenium是十分重要的!&/b&但这个和分析那些Cookies比起来简直是太小儿科了。&/p&&h2&&b&第四部:知乎模拟登陆&/b&&/h2&&p&知乎经常更新,因此即使方法写好了也可能不好用。因此我想到了一个终极方法,&b&半手动登陆&/b&。仅用selenium打开一个浏览器,然后手动输入账号密码,有验证码就填验证码。等到成功登陆之后使用“get_cookies()”函数来调出它的Cookies。这个方法虽然看起来笨了点,但是效率比那些几百行的代码不知道要高多少!而且你还可以用手机扫描二维码登陆!只要这些登陆操作是在selenium所打开的浏览器内进行,selenium就可以完全记录下这些Cookies。代码如下&b&:&/b&&/p&&div class=&highlight&&&pre&&code class=&language-text&&&span&&/span&import time
import requests
from selenium import webdriver
chromePath = r'浏览器储存的位置'
wd = webdriver.Chrome(executable_path= chromePath)
time.sleep(45)#设定45秒睡眠,期间进行手动登陆。十分关键,下面有解释。
cookies = wd.get_cookies()#调出Cookies
req = requests.Session()
for cookie in cookies:
req.cookies.set(cookie['name'],cookie['value'])
req.headers.clear()
test = req.get('待测试的链接')
&/code&&/pre&&/div&&p&&b&req.headers.clear() &/b&是删除原始req里面标记有python机器人的信息。这个信息会被一些网站(比如知乎)捕捉到。造成登陆爬取失败。务必要删除!&/p&&p&&b&time.sleep()&/b&可以暂停执行下面的程序。在此期间你可以进行手动登陆,扫描二维码等。然后在45秒过后再让python执行后面的“cookies = wd.get_cookies()”。selenium的get.cookies方程可以抓取到你进行手动登陆过后的cookies。时间值的设定根据自己需要的时间。如果你在程序中已经将网站名、用户名、密码、等全部输入就剩下一个验证码需要手动的话,仅设定几秒钟就可以了!&b&加入time.sleep的好处就是程序本身是不需要停止执行的!下面的所有程序可以无缝衔接。&/b&&/p&&p&感谢大家读到这,文章最初说的懒人方法就是我登陆知乎用到的这种方法,半手动。但是也不要觉得它不好,毕竟我们的目的是&b&爬取网站的内容,尽快解决登陆问题。开始爬取工作才是正确的方向。这个方法可以帮您迅速登陆网站,节省大量时间。&/b&这个方法万能的原理就是它调用了真实的浏览器。那么只要在正常情况下浏览器能够访问的网站就都可以用这个方法登陆。&/p&&p&-------------------------------------------&/p&&h2&正文结束-以下是常见问题集锦以及代码赠送&/h2&&p&&b&问题1:如果网站禁用selenium怎么办?&/b&&/p&&p&解决方案:这种情况极少。网站如果采用这种反爬虫手段的话很容易误伤真正的用户。如果真的遇到这种情况,只需要隐藏掉selenium中显示你是机器人的信息就可以了。参考链接:&a href=&http://link.zhihu.com/?target=https%3A//stackoverflow.com/questions//can-a-website-detect-when-you-are-using-selenium-with-chromedriver& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&Can a website detect when you are using selenium with chromedriver?&/a&&/p&&p&&b&问题2:如何让新打开的webdriver带有曾经保存过的cookies?&/b&&/p&&p&解决方案:将获取的cookies保存在本地。下次登陆的时候直接导入本地的cookies。参考链接:&a href=&http://link.zhihu.com/?target=https%3A//stackoverflow.com/questions//how-to-save-and-load-cookies-using-python-selenium-webdriver& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&How to save and load cookies using python selenium webdriver&/a&&/p&&p&&br&&/p&&h2&友情赠送写好的登陆代码-知乎&/h2&&div class=&highlight&&&pre&&code class=&language-python3&&&span&&/span&&span class=&kn&&from&/span& &span class=&nn&&selenium&/span& &span class=&k&&import&/span& &span class=&n&&webdriver&/span&
&span class=&kn&&from&/span& &span class=&nn&&requests&/span& &span class=&k&&import&/span& &span class=&n&&Session&/span&
&span class=&kn&&from&/span& &span class=&nn&&time&/span& &span class=&k&&import&/span& &span class=&n&&sleep&/span&
&span class=&n&&req&/span& &span class=&o&&=&/span& &span class=&n&&Session&/span&&span class=&p&&()&/span&
&span class=&n&&req&/span&&span class=&o&&.&/span&&span class=&n&&headers&/span&&span class=&o&&.&/span&&span class=&n&&clear&/span&&span class=&p&&()&/span&
&span class=&n&&chromePath&/span& &span class=&o&&=&/span& &span class=&s1&&r'D:\Python Program\chromedriver.exe'&/span&
&span class=&n&&wd&/span& &span class=&o&&=&/span& &span class=&n&&webdriver&/span&&span class=&o&&.&/span&&span class=&n&&Chrome&/span&&span class=&p&&(&/span&&span class=&n&&executable_path&/span&&span class=&o&&=&/span& &span class=&n&&chromePath&/span&&span class=&p&&)&/span&
&span class=&n&&zhihuLogInUrl&/span& &span class=&o&&=&/span& &span class=&s1&&'https://www.zhihu.com/signin'&/span&
&span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&get&/span&&span class=&p&&(&/span&&span class=&n&&zhihuLogInUrl&/span&&span class=&p&&)&/span&
&span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&find_element_by_xpath&/span&&span class=&p&&(&/span&&span class=&s1&&'/html/body/div[1]/div/div[2]/div[2]/div[1]/div[1]/div[2]/span'&/span&&span class=&p&&)&/span&&span class=&o&&.&/span&&span class=&n&&click&/span&&span class=&p&&()&/span&
&span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&find_element_by_xpath&/span&&span class=&p&&(&/span&&span class=&s1&&'/html/body/div[1]/div/div[2]/div[2]/form/div[1]/div[1]/input'&/span&&span class=&p&&)&/span&&span class=&o&&.&/span&&span class=&n&&send_keys&/span&&span class=&p&&(&/span&&span class=&s1&&'username'&/span&&span class=&p&&)&/span&
&span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&find_element_by_xpath&/span&&span class=&p&&(&/span&&span class=&s1&&'/html/body/div[1]/div/div[2]/div[2]/form/div[1]/div[2]/input'&/span&&span class=&p&&)&/span&&span class=&o&&.&/span&&span class=&n&&send_keys&/span&&span class=&p&&(&/span&&span class=&s1&&'password'&/span&&span class=&p&&)&/span&
&span class=&n&&sleep&/span&&span class=&p&&(&/span&&span class=&mi&&10&/span&&span class=&p&&)&/span& &span class=&c1&&#手动输入验证码 &/span&
&span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&find_element_by_xpath&/span&&span class=&p&&(&/span&&span class=&s1&&'/html/body/div[1]/div/div[2]/div[2]/form/div[2]/button'&/span&&span class=&p&&)&/span&&span class=&o&&.&/span&&span class=&n&&submit&/span&&span class=&p&&()&/span&
&span class=&n&&sleep&/span&&span class=&p&&(&/span&&span class=&mi&&10&/span&&span class=&p&&)&/span&&span class=&c1&&#等待Cookies加载&/span&
&span class=&n&&cookies&/span& &span class=&o&&=&/span& &span class=&n&&wd&/span&&span class=&o&&.&/span&&span class=&n&&get_cookies&/span&&span class=&p&&()&/span&
&span class=&k&&for&/span& &span class=&n&&cookie&/span& &span class=&ow&&in&/span& &span class=&n&&cookies&/span&&span class=&p&&:&/span&
&span class=&n&&req&/span&&span class=&o&&.&/span&&span class=&n&&cookies&/span&&span class=&o&&.&/span&&span class=&n&&set&/span&&span class=&p&&(&/span&&span class=&n&&cookie&/span&&span class=&p&&[&/span&&span class=&s1&&'name'&/span&&span class=&p&&],&/span&&span class=&n&&cookie&/span&&span class=&p&&[&/span&&span class=&s1&&'value'&/span&&span class=&p&&])&/span&
&/code&&/pre&&/div&&p&&/p&
Python模拟登陆让不少人伤透脑筋,今天奉上一种万能登陆方法。你无须精通HTML,甚至也无须精通Python,但却能让你成功的进行模拟登陆。本文讲的是登陆所有网站的一种方法,并不局限于微博与知乎,仅用其作为例子来讲解。用到的库有“selenium”和“requests”…
&figure&&img src=&https://pic4.zhimg.com/v2-ced195eb911_b.jpg& data-rawwidth=&1920& data-rawheight=&1080& class=&origin_image zh-lightbox-thumb& width=&1920& data-original=&https://pic4.zhimg.com/v2-ced195eb911_r.jpg&&&/figure&&p&&b&文章来源:&a href=&http://link.zhihu.com/?target=https%3A//www.digquant.com.cn/forum.php%3Fmod%3Dforumdisplay%26fid%3D37& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&量化策略研究专栏 | DigQuant 专业量化研究社区&/a&&br&文章传送门:&a href=&http://link.zhihu.com/?target=https%3A//www.digquant.com.cn/forum.php%3Fmod%3Dviewthread%26tid%3D214%26extra%3Dpage%253D2& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&【年度干货】2017上半年所有券商金融工程研究报告(完结)&/a&&/b& &/p&&p&&br&&/p&&p&&b&本文来自点宽网DigQuant量化专栏——量化投资与机器学习专栏旗下文章 &/b&&/p&&figure&&img src=&https://pic2.zhimg.com/v2-f210f2ed4bc036e281a0a9_b.png& data-rawwidth=&1230& data-rawheight=&304& class=&origin_image zh-lightbox-thumb& width=&1230& data-original=&https://pic2.zhimg.com/v2-f210f2ed4bc036e281a0a9_r.jpg&&&/figure&&p&&br&&/p&&p&&b&第一部分:&a href=&https://zhuanlan.zhihu.com/p/& class=&internal&&研报第一部分&/a&&/b&&/p&&h2&&b&编辑部声明 &/b&&/h2&&p&由于百度网盘经常出现连接失效、大家获取不便、文档保存提取优化等一系列问题。 &br&&br&很幸运,&b&DigQuant点宽社区&/b&为我们提供了依托于&b&微软云的存储&/b&。公众号所推出的所有的干货资料,全部会放在点宽社区上。便于大家下载浏览。 &br&&br&&b&我们以后会按月更新,方便大家及时阅读研究。&/b& &/p&&figure&&img src=&https://pic2.zhimg.com/v2-ed00c4ac852c91d2a15daedbef608b0d_b.png& data-rawwidth=&1726& data-rawheight=&1674& class=&origin_image zh-lightbox-thumb& width=&1726& data-original=&https://pic2.zhimg.com/v2-ed00c4ac852c91d2a15daedbef608b0d_r.jpg&&&/figure&&p&&br&&/p&&figure&&img src=&https://pic1.zhimg.com/v2-f32a868ad6b6eab1b78a766b6f06745c_b.png& data-rawwidth=&1722& data-rawheight=&1668& class=&origin_image zh-lightbox-thumb& width=&1722& data-original=&https://pic1.zhimg.com/v2-f32a868ad6b6eab1b78a766b6f06745c_r.jpg&&&/figure&&p&&br&&/p&&figure&&img src=&https://pic2.zhimg.com/v2-09fc0b2ac9c21c54ec79e_b.png& data-rawwidth=&1696& data-rawheight=&1054& class=&origin_image zh-lightbox-thumb& width=&1696& data-original=&https://pic2.zhimg.com/v2-09fc0b2ac9c21c54ec79e_r.jpg&&&/figure&&p&&b&研报下载链接:&a href=&http://link.zhihu.com/?target=https%3A//www.digquant.com.cn/forum.php%3Fmod%3Dviewthread%26tid%3D214%26extra%3Dpage%253D2& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&研报下载&/a&&/b&&/p&&p&&/p&
文章来源: 文章传送门: 本文来自点宽网DigQuant量化专栏——量化投资与机器学习专栏旗下文章
第一部分:编辑部声明 由于百度网盘经常…
&figure&&img src=&https://pic3.zhimg.com/c75f5ba90f140ad2019ec8_b.jpg& data-rawwidth=&580& data-rawheight=&333& class=&origin_image zh-lightbox-thumb& width=&580& data-original=&https://pic3.zhimg.com/c75f5ba90f140ad2019ec8_r.jpg&&&/figure&&p&作者:Myron
原文链接:&a href=&https://link.zhihu.com/?target=https%3A//uqer.io/community/share/e5b6& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&【Active Portfolio Management】均值方差分析工具之特征组合(Characteristic Portfolio)&/a&&/p&&h2&【序言】&/h2&&ul&&li&《Active Portfolio Management》是很好的一本量化投资学的圣经,它条理、科学的论述了构建投资组合所需要的知识框架并给出了相应的数学分析工具,对于实际的投资有着重要的指导作用。本研究参考《Active Portfolio Management》CAPM章节,介绍一种基于均值方差理论的构建组合权重的有效工具:特征组合。&/li&&/ul&&h2&【特征组合】&/h2&&ul&&li&资产有很多属性,例如贝塔、预期收益率、市盈率、市值等,通常我们称之为因子。每个股票对应于某个属性都有特定的数值,这个数值我们称之为股票在这个属性中的暴露度。从线性空间的角度,属性即代表了某种维度,而属性的暴露度就代表了股票在这个维度上的映射数值。&/li&&li&假设我们有一个股票池 stock = [s1,s2,...,sn],属性attr = [a1,a2,...,an] 是股票池中的股票对应于因子的暴露度。我们希望根据股票池构建一个投资组合 ptf = [w1,w2,...,wn],使得ptf对于该属性的暴露度为1,即:&img src=&https://www.zhihu.com/equation?tex=%5Csum_%7Bi%3D1%7D%5E%7Bn%7D%7Ba_%7Bi%7Dw_%7Bi%7D++%7D+& alt=&\sum_{i=1}^{n}{a_{i}w_{i}
} & eeimg=&1&&=1。对资产在某个属性上暴露度做归一化,能够有效公平的验证属性对于资产盈利的解释能力。&/li&&li&然而上面的条件会有无穷多解,我们希望构建一个风险最小的组合,同时组合对于属性attr的暴露度为1,这个组合我们称之为属性attr的特征组合ptfAttr。ptfAttr是基于属性attr的最小风险组合,它是根据属性attr投资的最有效组合。通过构建属性attr的特征组合,我们也可以验证某个attr对于资产盈利的解释能力和产生α的能力。&/li&&/ul&&h2&【特征组合基本建模】&/h2&&ul&&li&&p&我们将风险定义为超额收益率的年化标准差,变量声明如下:&/p&&ul&&li&w:风险资产的头寸权重,即组合在每只风险资产上的投资权重;&/li&&li&V:风险资产超额收益率间的协方差矩阵;&/li&&li&a:资产的特征向量&/li&&/ul&&/li&&li&&p&可以将特征组合求解简单描述成以下QP问题:&/p&&/li&&ul&&li&min &img src=&https://www.zhihu.com/equation?tex=w%5E%7Bt%7D+& alt=&w^{t} & eeimg=&1&&Vw&/li&&li&s.t. &img src=&https://www.zhihu.com/equation?tex=w%5E%7Bt%7D+& alt=&w^{t} & eeimg=&1&&a=1&/li&&/ul&&/ul&&h2&【特征组合方法】&/h2&&ul&&li&下面cell中的类“charPtf”为求解资产相对于某个特征的特征组合(&a href=&https://link.zhihu.com/?target=https%3A//uqer.io/community/share/e5b6& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&点击查看原文代码)&/a&&/li&&/ul&&p&The attribute portfolio is
[ 0.]]&br&&/p&&h2&【特征组合之组合C】&/h2&&ul&&li&&p&&img src=&https://www.zhihu.com/equation?tex=e%5E%7BT%7D+& alt=&e^{T} & eeimg=&1&&=[1,1,...,1]的特征组合&img src=&https://www.zhihu.com/equation?tex=w_%7Bc%7D+& alt=&w_{c} & eeimg=&1&&称之为组合C。它被称为最小方差组合,它的特点是组合C中的所有资产相对于组合C本身的 β=1,它构建一组权重组合使得组合资产在过去收益率的基础上达到最小的方差,降低资产的波动率。&/p&&/li&&li&&p&下例展示了上证50指数成分股的组合C的表现(&a href=&https://link.zhihu.com/?target=https%3A//uqer.io/community/share/e5b6& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&点击查看原文代码&/a&):&/p&&/li&&/ul&&figure&&img src=&https://pic2.zhimg.com/2f7efff2cd62ff29184da98_b.jpg& data-rawwidth=&798& data-rawheight=&438& class=&origin_image zh-lightbox-thumb& width=&798& data-original=&https://pic2.zhimg.com/2f7efff2cd62ff29184da98_r.jpg&&&/figure&&ul&&li&特征组合的表现是基于预期收益率协方差V本身的,与它的计算精度强相关,而V本身的计算又与使用数据的历史周期有关,使用不同的历史周期计算得到的结果不同。理论上,使用历史周期越长,V越准,特征组合对于β的拟合度越好,相对于基准的残差波动越小。事实证明的确如此,如下例为利用过去50天数据计算的V的特征组合的表现,其相对于基准的残差波动就比上面利用150天的残差波动大很多(&a href=&https://link.zhihu.com/?target=https%3A//uqer.io/community/share/e5b6& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&点击查看原文代码&/a&)。&/li&&/ul&&figure&&img src=&https://pic2.zhimg.com/5e384f3d5d3104eadff8c_b.jpg& data-rawwidth=&800& data-rawheight=&453& class=&origin_image zh-lightbox-thumb& width=&800& data-original=&https://pic2.zhimg.com/5e384f3d5d3104eadff8c_r.jpg&&&/figure&&br&&h2&【特征组合之因子分析】&/h2&&ul&&li&当我们分析某因子有效性的时候,可以利用股票池针对某特定因子预期收益率的特征组合来判断因子的有效性和产生α的能力。&/li&&li&因子的预期收益率因为很难估算,假设针对股票i的某个因子做中性化、归一化、标准化之后的信号为&img src=&https://www.zhihu.com/equation?tex=f_%7Bi%7D+& alt=&f_{i} & eeimg=&1&&,我们默认超额残差收益率为: &img src=&https://www.zhihu.com/equation?tex=r_%7Bi%7D+& alt=&r_{i} & eeimg=&1&&=&img src=&https://www.zhihu.com/equation?tex=f_%7Bi%7D+& alt=&f_{i} & eeimg=&1&&+c,
c为无风险收益率。那么该因子预期收益率的特征可写为:r = [r1,r2,...,rn]。那么r的特征组合&img src=&https://www.zhihu.com/equation?tex=w_%7Br%7D+& alt=&w_{r} & eeimg=&1&&便能够展示因子的盈利特性。&/li&&br&&li&下例展示了因子“净资产收益率ROE”预期收益特征组合的表现(&a href=&https://link.zhihu.com/?target=https%3A//uqer.io/community/share/e5b6& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&点击查看&/a&):&/li&&/ul&&figure&&img src=&https://pic4.zhimg.com/efdf3a814d52d7f9acd1_b.jpg& data-rawwidth=&801& data-rawheight=&455& class=&origin_image zh-lightbox-thumb& width=&801& data-original=&https://pic4.zhimg.com/efdf3a814d52d7f9acd1_r.jpg&&&/figure&&br&&ul&&li&下例展示了因子“市盈率PE”预期收益特征组合的表现(&a href=&https://link.zhihu.com/?target=https%3A//uqer.io/community/share/e5b6& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&点击查看&/a&):&/li&&/ul&&figure&&img src=&https://pic1.zhimg.com/e2d85cea1c8dc88b8da397f1c4478dd1_b.jpg& data-rawwidth=&791& data-rawheight=&448& class=&origin_image zh-lightbox-thumb& width=&791& data-original=&https://pic1.zhimg.com/e2d85cea1c8dc88b8da397f1c4478dd1_r.jpg&&&/figure&&br&&ul&&li&从上面“ROE”和“PE”预期收益率特征组合的表现来看,“PE”因子更能够带来α收益。&/li&&li&因子预期收益率的特征组合是一种更为严谨、规范的检验因子有效性的方法。&/li&&/ul&&p&欢迎到&a href=&https://link.zhihu.com/?target=https%3A//uqer.io/community/share/e5b6& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&社区&/a&交流探讨&/p&&p&另:2000万实盘FOF基金投资经理正在招募中,感兴趣的朋友欢迎报名参加 &a href=&https://link.zhihu.com/?target=https%3A//uqer.io/mom/home/%3Fsource%26xueqi& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&报名地址&/a&&/p&
作者:Myron 原文链接:【序言】《Active Portfolio Management》是很好的一本量化投资学的圣经,它条理、科学的论述了构建投资组合所需要的知识框架并给出了相应的…
&p&凯纳 君耀 宽德 青骓 涵德 思勰 锐天 博普 金锝 富善 幻方 均直 明汯 九坤 博煊 黑翼&br&&br&&br&&br&&br&&br&&br&&br&另外 很多券商自营部做得也非常不错&br&&br&&br&&br&&br&&br&&br&&br&绝大部分打旗号的吹业绩的 最多也就是自营产品不错 更甚者就是骗子 至少是骗管理费的 闷声发大财依然是投资界主流&/p&
凯纳 君耀 宽德 青骓 涵德 思勰 锐天 博普 金锝 富善 幻方 均直 明汯 九坤 博煊 黑翼 另外 很多券商自营部做得也非常不错 绝大部分打旗号的吹业绩的 最多也就是自营产品不错 更甚者就是骗子 至少是骗管理费的 闷声发大财依然是投资界主流
&figure&&img src=&https://pic4.zhimg.com/v2-fbf6e65a45fe_b.jpg& data-rawwidth=&1024& data-rawheight=&646& class=&origin_image zh-lightbox-thumb& width=&1024& data-original=&https://pic4.zhimg.com/v2-fbf6e65a45fe_r.jpg&&&/figure&&p&问题来源:&a href=&https://www.zhihu.com/question/& class=&internal&&知道盈亏比和胜率,怎样才能做到最佳资金管理? - 投资 - 知乎&/a&&/p&&p&试过回答问题,但是不能修改,也不知道是否是知乎的Bug,所以把自己的理解单独发篇文章。&/p&&b&&u&原问题:&/u&&/b&&br&知道盈亏比和胜率,怎样才能做到最佳资金管理?
资金管理是我很头疼的问题,在收益和风险中摇摆,哪个点是最佳的平衡点?例如有人说资金最大亏损不能超过2%或8%。我感觉这对于胜率低,高盈亏比是对的。而对于高胜率,低盈亏比的系统来说,好不容易做一次,是非常渴望重仓的,那么问题来了,假设是一个高胜率80%,低盈亏比3比4,你会怎么设计资金管理,控制好风控呢?
&p&----------------------------------------------------------------------------------------------&/p&
问题已经给定策略的胜率,盈亏比,所以默认:已经通过回测以及实盘得到策略的表现数据。 &p&
资金管理是投资策略中重要的一环,回答如何优化资金管理这个问题之前,我们先说明投资策略的评价要素和设计原则。 &/p&&p&
首先,常见的投资策略的评价的出发点就是盈利能力和风险控制能力,这两个维度细分之后主要有以下7个要素:&/p&&p&&b&1.利润率&br&&/b&&b&2.最大回撤比例&br&&/b&&b&3.平均盈亏比&br&&/b&&b&4.胜率&br&&/b&&b&5.最大连续盈利/亏损次数&br&&/b&&b&6.单笔最大盈利/亏损&br&&/b&&b&7.交易次数&/b&&br&&br&&/p&&p&
很多时候,策略还可以通过夏普率进行基准比较,但是容易被疏忽的是,夏普率同样需要结合策略的风格,投资逻辑,偏Alpha还是Beta,低频还是高频,资金管理规模等等前提进行判断。
所以,以上7个要素可以比较全面的描述策略属性,在统一的口径下,能开始比较策略的优劣。 &/p&&p&
接下来回到资金管理。谈资金管理,除了策略的属性,我们还需要把握另一个关键:资金的风险偏好。
通常来说,可以按照资金的利润追逐和最大亏损承受能力将资金的风险偏好分为三类: &/p&&p&&b&1.高风险高回报率偏好型,主要考量盈利能力,回撤承担20%以上。&br&&/b&&b&2.中度风险偏好型,例如年化15-20%,回撤承担5%-10%。&br&&/b&&b&3.风险厌恶型,例如保本,固收类&/b&&/p&&p&
了解了管理资金的风险偏好之后,可以开始根据清盘线,警戒线开始设计策略的杠杆,完成策略的资金管理设计。
现在我们可以回到问题:
&br&&b&&u&1.最大亏损2%好还是8%?&/u&&/b&&br&
先不说固定止损本身就不是量化的最优止损策略,如果作为绝对止损的话,需要综合考虑的就是:
策略的最大回撤,单笔最大亏损,最大连续亏损次数以及资金的风险偏好:
&br&&b&最大清盘线&警戒线&= max(最大回撤比例,
单笔最大亏损*最大连续亏损)&/b&&br&&b&&u&&br&2.好不容易做一次,能否重仓?&/u&&/b&&br&
“好不容易做一次”也就是评价要素7交易次数的欠缺,这可能会引发因为策略交易样本过少而导致其他评价要素的失真。
是否能重仓,还是取决于资金的风险偏好。 &/p&&p&&br&&b&&u&3.胜率80%,盈亏比3:4怎么风控&/u&&/b&&br&
如果存在清盘线,请参考上述回答1的公式取得最大可亏损资金,如果不存在清盘线,最大可亏损资金为100%,可以计算该策略的破产风险(详细推导参考&a href=&http://link.zhihu.com/?target=http%3A//www.kogures.com/hitoshi/webtext/or-hasan-kakuritu/index.html& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&破産確率<OR<Web教材<木暮&/a& ):
X= 胜率 * X^(1+ 盈亏比) +(1-胜率)&/b&&b&破产可能=X^(资金/单笔亏损金额)&/b&&br&&br&胜率80%,盈亏比3:4可得X:
X=0.8* X^(1+0.75) + (1-0.8) = 0.293
&br&举两个实际例子:&br&例1:100万资金,单笔最大亏损40万情况下:
破产可能= 0.293^(100/40)=0.046
&br&例2:100万资金,单笔最大亏损4万情况下:
破产可能= 0.293^(100/4)=0.0
&br&&br&以上。&/p&
问题来源:试过回答问题,但是不能修改,也不知道是否是知乎的Bug,所以把自己的理解单独发篇文章。原问题: 知道盈亏比和胜率,怎样才能做到最佳资金管理?
资金管理是我很头疼的问题,在收益…
谢邀!&br&&br&回答之前先说一下,这个问题原来是这样的,&blockquote&炒股究竟应该关注技术性指标还是趋势性判断?&br&&/blockquote&但是这样的一个问题其实是不存在的,原因有两点。&br&一是,所有的技术分析的目的都不是判断涨跌幅度,更不是为了判断股价。技术分析中的所有努力都指向一点,就是判断趋势,这个无论是K线组合分析,还是技术指标的图表分析目的都是寻找趋势。所以所谓的趋势判断就是技术分析的一部分,所以孰优孰优的问题是不存在的。&br&二是,道氏理论中就有关于趋势的具体区分,&br&&blockquote&主要趋势&br&持续一年或以上,大部分股票将随大市上升或下跌,幅度一般超过20%。&br&中期趋势&br&与基本趋势完全相反的方向,持续期超过三星期,幅度为基本趋势的三分之一至三分之二。&br&短期趋势&br&只反映股票价格的短期变化,持续时间不超过六天。&/blockquote&如果按照题主所说的情况,现在做的都集中于短线和超短线,那么针对的其实是短期趋势,也就是我喜欢称为波动而不是趋势的这种小行情。所以在目的到底是需找什么级别的趋势不明确的前提下,这个问题也不能成立。&br&&br&但是鉴于题主这个问题对大多数入门者来说有极强的共性,那么我就修改了一下问题。加入,&br&&blockquote&技术分析都包含那些流派,之间的关系是怎么的?&br&&/blockquote&这样一来我先从各种类型的技术分析之间的历史和关系讲一下,大家对技术分析是什么,都有什么就会有一个比较清晰的认识,之后再选择适合自己的方式方法。&br&&br&现在已知的最早出现,而且现在还在使用的技术分析方式是蜡烛图,也就是我们现在每天都要看的&br&K线,&br&&blockquote&K线图 是技术分析的一种,最早为日本人于十九世纪所创,被当时日本米市的商人用来记录米市的行情与价格波动,包括开市价、收市价、最高价及最低价,阳烛代表当日升市,阴烛代表跌市。&br&&/blockquote&而道氏理论的成型和广泛传播出现在1902年,查尔斯.道去世之后。也就是说其实早于美国人提出完整的理论体系之前。东方就已经在实用层面上对一种商品的价格变动判断取得一定的成果。那么K线和K线组合分析有没有道理,存在的价值究竟怎么样腻?&br&&blockquote&通过K线图,人们能够把每日或某一周期的市况表现完全记录下来,股价经过一段时间的盘档后,在图上即形成一种特殊区域或形态,不同的形态显示出不同意义。可以从这些形态的变化中摸索出一些有规律的东西出来。K线图形态可分为&b&反转形态、整理形态及缺口和趋向线&/b&等。后K线图因其细腻独到的标画方式而被引入到股市及期货市场。&/blockquote&&figure&&img src=&https://pic4.zhimg.com/e4cccda88dfd0ada27cb6c7_b.jpg& data-rawwidth=&462& data-rawheight=&395& class=&origin_image zh-lightbox-thumb& width=&462& data-original=&https://pic4.zhimg.com/e4cccda88dfd0ada27cb6c7_r.jpg&&&/figure&单看一条K线就有上述14种情况,对应不同的多空情况。而这么个单个的K线两两组合,或者更多条组合在一起,就能说明更多的市场情绪和细节。&figure&&img src=&https://pic2.zhimg.com/f034e2d9aae2ebe0f422a72d_b.jpg& data-rawwidth=&419& data-rawheight=&529& class=&content_image& width=&419&&&/figure&这里请注意一下红色方框内的文字,对于所有K线组合的分析,其目的都是看涨或者是看跌,这是典型的寻找趋势。&br&而K线分析优势在于,&br&&blockquote&能够全面透彻地观察到市场的真正变化。我们从K线图中,既可看到股价(或大市)的趋势,也同时可以了解到每日市况的波动情形。&br&&/blockquote&&br&除了K线分析是单独发展出来的一支,后来被吸收进整个技术分析大家庭,成为股市图表最基础组成单位之外,剩下的技术分析理论都是在美国完成的。&br&&br&首先是1902之后总结完善的道氏理论,随后的就是1908年之后开始扬名立万的威廉江恩,再之后才是艾略特的波浪

我要回帖

更多关于 ka电路中代表什么意思 的文章

 

随机推荐